@arcgis/core 4.28.0-next.20230720 → 4.28.0-next.20230721
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/Color.js +1 -1
- package/analysis/AreaMeasurementAnalysis.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/featureSetUtils.js +1 -1
- package/arcade/featureset/actions/Top.js +1 -1
- package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
- package/arcade/featureset/support/FeatureSet.js +1 -1
- package/arcade/featureset/support/FeatureSetIterator.js +1 -1
- package/arcade/functions/convertdirection.js +1 -1
- package/arcade/functions/featuresetbase.js +1 -1
- package/arcade/functions/geomasync.js +1 -1
- package/arcade/functions/geomsync.js +1 -1
- package/arcade/lib/comment-handler.js +1 -1
- package/arcade/lib/parser.js +1 -1
- package/arcade/lib/scanner.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{75c28da8d0b02d612d69.js → 040b3fc9c9c0736dd893.js} +1 -1
- package/assets/esri/core/workers/chunks/0652f6a8d5221e978033.js +1 -0
- package/assets/esri/core/workers/chunks/{c13b332afdb3f6be1ec9.js → 092fda62b6f62c2e4869.js} +1 -1
- package/assets/esri/core/workers/chunks/{57e0ad037188bd2997e7.js → 0af18a96cbd4e2d35436.js} +1 -1
- package/assets/esri/core/workers/chunks/0b5eeec0f66c87a46a0c.js +1 -0
- package/assets/esri/core/workers/chunks/{68e568b67b6fb34393db.js → 0cad2b991d0d0fd07846.js} +1 -1
- package/assets/esri/core/workers/chunks/0dccbc6c2559fdc0c2ad.js +1 -0
- package/assets/esri/core/workers/chunks/256a82f6f6e1405fbcc6.js +1 -0
- package/assets/esri/core/workers/chunks/{bb9213899049e1db90da.js → 2c57c9bd71637c5bed8a.js} +1 -1
- package/assets/esri/core/workers/chunks/2cdbabcbfe32286ec78d.js +1 -0
- package/assets/esri/core/workers/chunks/{2b1c83453a862e01954b.js → 2d9d80b2d0042a9c09fb.js} +1 -1
- package/assets/esri/core/workers/chunks/2f9aec2238ff6cb99e09.js +1 -0
- package/assets/esri/core/workers/chunks/{7dbd3e6406fb3e3a1a8f.js → 3cf748c025f3936c1cb2.js} +1 -1
- package/assets/esri/core/workers/chunks/4481d1103363434f16da.js +1 -0
- package/assets/esri/core/workers/chunks/5ae325e6a795c72eac6c.js +1 -0
- package/assets/esri/core/workers/chunks/5e4dde2886a1027b4b96.js +1 -0
- package/assets/esri/core/workers/chunks/730eb7e5f617fdab4f10.js +1 -0
- package/assets/esri/core/workers/chunks/{5a2e6bed9431cf4f42b1.js → 740dc67038f554431f1b.js} +1 -1
- package/assets/esri/core/workers/chunks/{09178454bda15bb7929a.js → 7fbdfd1527582c52f9b6.js} +1 -1
- package/assets/esri/core/workers/chunks/{1c026947505a9ff94a53.js → 807742f38885fa90b4fe.js} +1 -1
- package/assets/esri/core/workers/chunks/82dfbc175b52c7a10475.js +1 -0
- package/assets/esri/core/workers/chunks/870a05451e074b58f19a.js +1 -0
- package/assets/esri/core/workers/chunks/8c5a8c1dfb086069bb06.js +1 -0
- package/assets/esri/core/workers/chunks/99a5a434e0bad48c7a5c.js +1 -0
- package/assets/esri/core/workers/chunks/9a5916c66dad91d01d5b.js +1 -0
- package/assets/esri/core/workers/chunks/9c133fd8c1fbd0295b86.js +1 -0
- package/assets/esri/core/workers/chunks/9cddb504079d396779ea.js +1 -0
- package/assets/esri/core/workers/chunks/a3a1d4f32e518e97d071.js +1 -0
- package/assets/esri/core/workers/chunks/{9548aa449fe3a300c015.js → a4fa40dc77e116c954ac.js} +1 -1
- package/assets/esri/core/workers/chunks/a54ec9929a7db879d5db.js +1 -0
- package/assets/esri/core/workers/chunks/afc5b84693757fda2bc8.js +1 -0
- package/assets/esri/core/workers/chunks/{591b5c277cfd3a4101a4.js → b08f2a4aa94087c6c367.js} +1 -1
- package/assets/esri/core/workers/chunks/c0e12f6a7bb2360e4c21.js +1 -0
- package/assets/esri/core/workers/chunks/c8e656cd470a17f538e9.js +1 -0
- package/assets/esri/core/workers/chunks/d0e203405f95e14b1399.js +1 -0
- package/assets/esri/core/workers/chunks/{ec72f492f24e67e008ae.js → d8e58dc14d3495f0830c.js} +1 -1
- package/assets/esri/core/workers/chunks/ddc393a012588f799f42.js +1 -0
- package/assets/esri/core/workers/chunks/de3baa85b1639c25458d.js +1 -0
- package/assets/esri/core/workers/chunks/e66cea26064ba8353af0.js +1 -0
- package/assets/esri/core/workers/chunks/ea478f2f4a19463e13fd.js +1 -0
- package/assets/esri/core/workers/chunks/eba197e45507f56f3ed0.js +1 -0
- package/assets/esri/core/workers/chunks/ebd006fcd568a7731115.js +1 -0
- package/assets/esri/core/workers/chunks/ef9a9a7d66d818720e20.js +1 -0
- package/assets/esri/core/workers/chunks/f3b458f55236566c940b.js +1 -0
- package/assets/esri/core/workers/chunks/fd0a91b9e0216cc269c3.js +1 -0
- package/assets/esri/core/workers/chunks/{a4fe220a912b1f428e49.js → fdd6403a8390d629392b.js} +1 -1
- package/assets/esri/themes/base/widgets/_Directions.scss +13 -7
- 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/array.js +1 -1
- package/core/Collection.js +1 -1
- package/core/accessorSupport/decorators/subclass.js +1 -1
- package/core/accessorSupport/ensureType.js +1 -1
- package/core/accessorSupport/get.js +1 -1
- package/core/accessorSupport/tracking.js +1 -1
- package/core/accessorSupport/utils.js +1 -1
- package/core/libs/rbush/PooledRBush.js +1 -1
- package/core/urlUtils.js +1 -1
- package/geometry/GeometryCursor.js +1 -1
- package/geometry/support/TileClipper.js +1 -1
- package/geometry/support/geodesicUtils.js +1 -1
- package/interfaces.d.ts +7 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/VectorTileLayer.js +1 -1
- package/layers/VoxelLayer.js +1 -1
- package/layers/WCSLayer.js +1 -1
- package/layers/effects/EffectView.js +1 -1
- package/layers/graphics/sources/geojson/geojson.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
- package/layers/mixins/ArcGISCachedService.js +1 -1
- package/layers/support/ElevationQuery.js +1 -1
- package/layers/support/MultidimensionalSubset.js +1 -1
- package/layers/support/TileInfo.js +1 -1
- package/layers/support/TileInfoTilemapCache.js +1 -1
- package/layers/support/TilemapCache.js +1 -1
- package/layers/support/rasterDatasets/multidimensionalUtils.js +1 -1
- package/layers/support/rasterDatasets/pamParser.js +1 -1
- package/layers/support/rasterDatasets/wcsCoverageParser.js +1 -1
- package/layers/support/rasterFormats/Raw.js +1 -1
- package/layers/support/rasterFormats/TiffDecoder.js +1 -1
- package/layers/support/rasterFunctions/ExtractBandFunction.js +1 -1
- package/layers/support/rasterFunctions/colormaps.js +1 -1
- package/layers/support/rasterFunctions/pixelUtils.js +1 -1
- package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/layers/voxel/VoxelDimension.js +1 -1
- package/layers/voxel/VoxelTransferFunctionStyle.js +1 -1
- package/layers/voxel/VoxelVolume.js +1 -1
- package/package.json +1 -1
- package/renderers/support/RasterSymbolizer.js +1 -1
- package/renderers/support/colorRampUtils.js +1 -1
- package/renderers/visualVariables/support/visualVariableUtils.js +1 -1
- package/rest/query/operations/pbfDehydratedFeatureSet.js +1 -1
- package/rest/query/operations/pbfJSONFeatureSet.js +1 -1
- package/rest/support/generateRendererUtils.js +1 -1
- package/smartMapping/raster/renderers/classBreaks.js +1 -1
- package/smartMapping/renderers/color.js +1 -1
- package/smartMapping/renderers/support/utils.js +1 -1
- package/smartMapping/renderers/type.js +1 -1
- package/smartMapping/renderers/univariateColorSize.js +1 -1
- package/smartMapping/support/adapters/support/utils.js +1 -1
- package/statistics/utils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/symbols/cim/GeometryWalker.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/effects/EffectArrow.js +1 -1
- package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
- package/symbols/support/symbolUtils.js +1 -1
- package/views/2d/constraints/ZoomConstraint.js +1 -1
- package/views/2d/engine/flow/dataUtils.js +1 -1
- package/views/2d/engine/flow/utils.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
- package/views/2d/engine/vectorTiles/expression/expression.js +1 -1
- package/views/2d/engine/vectorTiles/style/VectorTileSource.js +1 -1
- package/views/2d/engine/vectorTiles/tileInfoUtils.js +1 -1
- package/views/2d/engine/webgl/TurboLine.js +1 -1
- package/views/2d/engine/webgl/mesh/MeshData.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
- package/views/2d/interactive/editingTools/ControlPointsTransformTool.js +1 -1
- package/views/2d/interactive/editingTools/draw/DrawGraphicTool2D.js +1 -1
- package/views/2d/layers/BaseLayerView2D.js +1 -1
- package/views/2d/layers/BaseLayerViewGL2D.js +1 -1
- package/views/2d/layers/BitmapTileLayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/VectorTileLayerView2D.js +1 -1
- package/views/2d/layers/WMTSLayerView2D.js +1 -1
- package/views/2d/layers/features/support/rendererUtils.js +1 -1
- package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
- package/views/2d/layers/support/vectorTileDebugUtils.js +5 -0
- package/views/2d/tiling/TileInfoView.js +1 -1
- package/views/2d/tiling/TileInfoViewPOT.js +1 -1
- package/views/2d/tiling/TileQueue.js +1 -1
- package/views/2d/tiling.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/interactive/editingTools/moveGraphic/GraphicMoveTool.js +1 -1
- package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
- package/views/3d/layers/TiledLayerView3D.js +1 -1
- package/views/3d/layers/VectorTileLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/featureReference.js +1 -1
- package/views/3d/support/LaserLineRenderer.js +1 -1
- package/views/3d/terrain/Overlay.js +1 -1
- package/views/3d/terrain/OverlayFramebufferObject.js +1 -1
- package/views/3d/terrain/OverlayRenderTarget.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TileCompositor.js +1 -1
- package/views/3d/terrain/TileRenderer.js +1 -1
- package/views/3d/terrain/TilingScheme.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentData.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/interfaces.js +1 -1
- package/views/3d/webgl-engine/effects/ScreenSpaceGeometry.js +1 -1
- package/views/3d/webgl-engine/effects/SmaaRenderPass.js +1 -1
- package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
- package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
- package/views/3d/webgl-engine/lib/PathBuilder.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/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/WebGLLayer.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/parts/requireUtils.js +1 -1
- package/views/MapView.js +1 -1
- package/views/animation/pointToPoint/Path.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/draw/support/createUtils.js +1 -1
- package/views/interactive/SegmentLabels.js +1 -1
- package/views/interactive/editGeometry/EditGeometry.js +1 -1
- package/views/interactive/editGeometry/EditGeometryOperations.js +1 -1
- package/views/interactive/editGeometry/operations/UndoGroup.js +1 -1
- package/views/layers/GroupLayerView.js +1 -1
- package/views/webgl/ProgramCache.js +1 -1
- package/webscene/spec-certification/api.js +1 -1
- package/webscene/spec-certification/spec.js +1 -1
- package/webscene/spec-certification/utils.js +1 -1
- package/widgets/BuildingExplorer/BuildingNumericFilterViewModel.js +1 -1
- package/widgets/BuildingExplorer/BuildingPhase.js +1 -1
- package/widgets/BuildingExplorer/support/validation.js +1 -1
- package/widgets/Directions/support/resources.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/FeatureForm/FieldInput.js +1 -1
- package/widgets/FeatureForm/FormExpressionsManager.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/Histogram/HistogramViewModel.js +1 -1
- package/widgets/HistogramRangeSlider/HistogramRangeSliderViewModel.js +1 -1
- package/widgets/Legend/styles/Card.js +1 -1
- package/widgets/Legend/styles/support/univariateUtils.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/Legend/support/colorRampUtils.js +1 -1
- package/widgets/Legend/support/sizeRampUtils.js +1 -1
- package/widgets/Legend/support/utils.js +1 -1
- package/widgets/Popup.js +1 -1
- package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
- package/widgets/ScaleRangeSlider/ScaleRanges.js +1 -1
- package/widgets/ValuePicker/ValuePickerSlider.js +1 -1
- package/widgets/smartMapping/ClassedSizeSlider.js +1 -1
- package/widgets/smartMapping/ColorSizeSlider.js +1 -1
- package/widgets/smartMapping/HeatmapSlider/HeatmapSliderViewModel.js +1 -1
- package/widgets/smartMapping/SizeSlider.js +1 -1
- package/widgets/smartMapping/SmartMappingPrimaryHandleSliderViewModel.js +1 -1
- package/widgets/smartMapping/SmartMappingSliderViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/0210f4c2e1f3ed13041b.js +0 -1
- package/assets/esri/core/workers/chunks/07bb40162d97d098bc19.js +0 -1
- package/assets/esri/core/workers/chunks/0a18317566c1fcb68422.js +0 -1
- package/assets/esri/core/workers/chunks/0de65e03db8c611af9fb.js +0 -1
- package/assets/esri/core/workers/chunks/1a60d23a92bcf91dbb22.js +0 -1
- package/assets/esri/core/workers/chunks/205a0b34b698d5329854.js +0 -1
- package/assets/esri/core/workers/chunks/25211d5904ee9d5f4a9d.js +0 -1
- package/assets/esri/core/workers/chunks/26b12d1ea713c1e07701.js +0 -1
- package/assets/esri/core/workers/chunks/2bfa7ee324c32a56b0d3.js +0 -1
- package/assets/esri/core/workers/chunks/4510a17839405146130b.js +0 -1
- package/assets/esri/core/workers/chunks/524156c3f5383c2dd0e3.js +0 -1
- package/assets/esri/core/workers/chunks/59666ecb7c2c1f5a13b2.js +0 -1
- package/assets/esri/core/workers/chunks/5c005c9514354c77ec27.js +0 -1
- package/assets/esri/core/workers/chunks/620ec5c75561183d3d73.js +0 -1
- package/assets/esri/core/workers/chunks/68512670816f59c0e6a5.js +0 -1
- package/assets/esri/core/workers/chunks/6c7374ebc18b46b3480a.js +0 -1
- package/assets/esri/core/workers/chunks/75ba2af92da232067adb.js +0 -1
- package/assets/esri/core/workers/chunks/7c1f0598a016516dcec3.js +0 -1
- package/assets/esri/core/workers/chunks/8dcec8d1b670d2b7ea2b.js +0 -1
- package/assets/esri/core/workers/chunks/8e07dfb6fc2673b640cb.js +0 -1
- package/assets/esri/core/workers/chunks/9050b167355588b7003d.js +0 -1
- package/assets/esri/core/workers/chunks/9230d68799f0b0b9ef36.js +0 -1
- package/assets/esri/core/workers/chunks/af4083f2aad5f5d49dde.js +0 -1
- package/assets/esri/core/workers/chunks/b0a57718a0765d1c8df0.js +0 -1
- package/assets/esri/core/workers/chunks/b431b81a7bf45dd527da.js +0 -1
- package/assets/esri/core/workers/chunks/bda311ad48efdb265939.js +0 -1
- package/assets/esri/core/workers/chunks/d5cce09fbe16cbb8fee4.js +0 -1
- package/assets/esri/core/workers/chunks/da547c3cabe4a89c3ce6.js +0 -1
- package/assets/esri/core/workers/chunks/dd295fa57b45b7ec4ec5.js +0 -1
- package/assets/esri/core/workers/chunks/f553b464e969d45bf451.js +0 -1
- package/assets/esri/core/workers/chunks/f5865294983eb160de8c.js +0 -1
- package/assets/esri/core/workers/chunks/fdb7b1fbdb6fe091ad83.js +0 -1
- package/views/2d/tiling/PagedTileQueue.js +0 -5
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7420,5732],{5732:(t,e,n)=>{n.d(e,{c:()=>s,g:()=>r});var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}},40932:(t,e,n)=>{n.d(e,{Ue:()=>Nn,G8:()=>Rn});var s=n(3892),r=n(20102),o=n(22974),i=n(43697),a=n(5600),u=(n(75215),n(67676),n(80442),n(52011)),l=(n(92604),n(96674));let c=class extends l.wq{constructor(){super(...arguments),this.raster=void 0}};(0,i._)([(0,a.Cb)({json:{write:!0}})],c.prototype,"raster",void 0),c=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.AspectFunctionArguments")],c);const p=c;var f;let h=f=class extends p{clone(){return new f({raster:this.raster})}};h=f=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.AspectFunctionArguments")],h);const m=h;var d=n(90578),g=n(5847),y=n(25972);const b=new Set(["slope","aspect","curvature","hillshade","shadedrelief"]);let x=class extends l.wq{constructor(){super(...arguments),this.functionArguments=null,this.readingBufferSize=0,this.id=-1,this.isNoopProcess=!1,this.rawInputBandIds=[],this.isInputBandIdsSwizzled=!1,this.swizzledBandSelection=[],this.isBranch=!1,this._bindingResult=null}get supportsGPU(){return this._bindingResult.supportsGPU}get flatWebGLFunctionChain(){const t=this.getWebGLProcessorDefinition();if(!t)return null;const e=[t],{parameters:n}=t;let s=n.rasters||n.raster&&[n.raster];for(;s?.length;){e.unshift(...s);const t=[];for(let e=0;e<s.length;e++){const{parameters:n}=s[e],r=n.rasters||n.raster&&[n.raster];r?.length&&t.push(...r)}s=t}for(let t=e.length-1;t>=0;t--)e[t].isNoopProcess&&e.splice(t,1);let r=!1;for(let t=0;t<e.length;t++){const n=e[t];n.id=e.length-t-1;const{rasters:s}=n.parameters;r=r||null!=s&&s.length>1}const o=e.some((({name:t})=>b.has(t.toLowerCase())));return{functions:e,hasBranches:r,hasSurfaceFunction:o}}bind(t,e=!1,n=-1){this.id=n+1;const s=this._getRasterValues();let r=!0;for(let n=0;n<s.length;n++){const o=s[n];if(null!=o&&this._isRasterFunctionValue(o)){const s=o.bind(t,e,this.id+n);if(!s.success)return this._bindingResult=s,s;r=r&&s.supportsGPU}}return!this.rasterInfo||e?(this.sourceRasterInfos=this._getSourceRasterInfos(t),this._bindingResult=this._bindSourceRasters(),this._bindingResult.success&&this._patchRasterInfo(),this._bindingResult.supportsGPU=r&&this._bindingResult.supportsGPU,this.processInputBandIds(),this._bindingResult):(this._bindingResult={success:!0,supportsGPU:!0},this.processInputBandIds(),this._bindingResult)}process(t){const e=this._getRasterValues(),n=0===e.length?t.pixelBlocks??t.primaryPixelBlocks:e.map((e=>this._readRasterValue(e,t)));return this._processPixels({...t,pixelBlocks:n})}processInputBandIds(){const t=this._getRasterValues().filter(this._isRasterFunctionValue);let e;if(t.length>1){const e=t.map((t=>t.processInputBandIds()[0]));this.rawInputBandIds=e,this.isInputBandIdsSwizzled=this.rawInputBandIds.some(((t,e)=>t!==e));const n=t.filter((t=>"ExtractBand"===t.functionName));return n.length&&n.forEach(((t,e)=>{t.isInputBandIdsSwizzled=!0,t.swizzledBandSelection=[e,e,e]})),this.rawInputBandIds}const n=t[0];if(n){if(e=n.processInputBandIds(),n.isInputBandIdsSwizzled)return this.rawInputBandIds=e,e}else{e=[];const{bandCount:t}=this.sourceRasterInfos[0];for(let n=0;n<t;n++)e.push(n)}const s=this._getInputBandIds(e);return this.isInputBandIdsSwizzled=s.some(((t,e)=>t!==e)),this.rawInputBandIds=s,this.rawInputBandIds}getPrimaryRasters(){const t=[],e=[];return this._getPrimaryRasters(this,t,e),{rasters:t,rasterIds:e}}getWebGLProcessorDefinition(){const t=this._getWebGLParameters(),{raster:e,rasters:n}=this.functionArguments;return n&&Array.isArray(n)&&n.length?(t.rasters=n.map((t=>this._isRasterFunctionValue(t)?t.getWebGLProcessorDefinition():"number"==typeof t?{name:"Constant",parameters:{value:t},pixelType:"f32",id:-1,isNoopProcess:!1}:{name:"Identity",parameters:{value:t},pixelType:"f32",id:-1,isNoopProcess:!1})),t.rasters.some((t=>null!=t))||(t.rasters=null)):this._isRasterFunctionValue(e)&&(t.raster=e.getWebGLProcessorDefinition()),{name:this.functionName,parameters:t,pixelType:this.outputPixelType,id:this.id,isNoopProcess:this.isNoopProcess}}_getOutputPixelType(t){return"unknown"===this.outputPixelType?t:this.outputPixelType??t}_getWebGLParameters(){return{}}_getInputBandIds(t){return t}_isOutputRoundingNeeded(){const{outputPixelType:t}=this;return(t?.startsWith("u")||t?.startsWith("s"))??!1}_getRasterValues(){const{rasterArgumentNames:t}=this;return"rasters"===t[0]?this.functionArguments.rasters??[]:t.map((t=>this.functionArguments[t])).flat()}_getSourceRasterInfos(t){const e=this._getRasterValues(),{rasterInfos:n,rasterIds:s}=t;if(0===e.length)return n;const r=e.map((t=>t&&"object"==typeof t&&"bind"in t&&t.rasterInfo?t.rasterInfo:"string"==typeof t&&s.includes(t)?n[s.indexOf(t)]:"number"!=typeof t?n[0]:void 0)),o=r.find((t=>t))??n[0];return r.forEach(((t,e)=>{void 0===t&&(r[e]=o)})),r}_getPrimaryRasterId(t){return t?.url}_getPrimaryRasters(t,e=[],n=[]){for(let s=0;s<t.sourceRasters.length;s++){const r=t.sourceRasters[s];if("number"!=typeof r)if("bind"in r)this._getPrimaryRasters(r,e,n);else{const t=r,s=this._getPrimaryRasterId(t);if(null==s)continue;n.includes(s)||(this.mainPrimaryRasterId===s?(e.unshift(t),n.unshift(s)):(e.push(t),n.push(s)))}}}_isRasterFunctionValue(t){return null!=t&&"object"==typeof t&&"getWebGLProcessorDefinition"in t}_readRasterValue(t,e){const{primaryPixelBlocks:n}=e;if(null==t||"$$"===t){const t=n[0];return null==t?null:t.clone()}if("string"==typeof t){const s=e.primaryRasterIds.indexOf(t);return-1===s?null:n[s]}if("number"==typeof t){const e=n[0];if(null==e)return null;const{width:s,height:r,pixelType:o,mask:i}=e,a=i?new Uint8Array(i):null,u=new Float32Array(s*r);u.fill(t);const l=this.sourceRasterInfos[0].bandCount,c=new Array(l).fill(u);return new g.Z({width:s,height:r,pixelType:o,pixels:c,mask:a})}return t.process(e)}_patchRasterInfo(){const{rasterInfo:t}=this;if(!t?.keyProperties)return;const{bandCount:e,keyProperties:n,statistics:s,histograms:r}=t,o=n.BandProperties;o&&o.length!==e&&(t.keyProperties={...n,BandProperties:void 0}),s&&s.length!==e&&(t.statistics=s.length>e?s.slice(0,e):null),r&&r.length!==e&&(t.histograms=r.length>e?r.slice(0,e):null),n.BAND_COUNT&&Number(n.BAND_COUNT)!==e&&(t.keyProperties={...n,BAND_COUNT:"string"==typeof n.BAND_COUNT?String(e):e})}};(0,i._)([(0,a.Cb)({json:{write:!0}})],x.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],x.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],x.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}}),(0,d.p)((t=>t?.toLowerCase()))],x.prototype,"outputPixelType",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],x.prototype,"mainPrimaryRasterId",void 0),(0,i._)([(0,a.Cb)()],x.prototype,"sourceRasters",void 0),(0,i._)([(0,a.Cb)({type:[y.Z],json:{write:!0}})],x.prototype,"sourceRasterInfos",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],x.prototype,"rasterInfo",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],x.prototype,"readingBufferSize",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],x.prototype,"id",void 0),(0,i._)([(0,a.Cb)()],x.prototype,"isNoopProcess",void 0),(0,i._)([(0,a.Cb)()],x.prototype,"supportsGPU",null),(0,i._)([(0,a.Cb)()],x.prototype,"rawInputBandIds",void 0),(0,i._)([(0,a.Cb)()],x.prototype,"isInputBandIdsSwizzled",void 0),(0,i._)([(0,a.Cb)()],x.prototype,"swizzledBandSelection",void 0),(0,i._)([(0,a.Cb)()],x.prototype,"isBranch",void 0),(0,i._)([(0,a.Cb)()],x.prototype,"flatWebGLFunctionChain",null),(0,i._)([(0,a.Cb)()],x.prototype,"_bindingResult",void 0),x=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.BaseRasterFunction")],x);const w=x;var v=n(63342);let _=class extends w{constructor(){super(...arguments),this.functionName="Aspect",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const t=this.sourceRasterInfos[0];this.isGCS=t.spatialReference?.isGeographic??!1,this.outputPixelType=this._getOutputPixelType("f32");const e=t.clone();return e.pixelType=this.outputPixelType,e.statistics=[{min:-1,max:360,avg:180,stddev:30}],e.histograms=null,e.colormap=null,e.attributeTable=null,e.bandCount=1,this.rasterInfo=e,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{extent:n,primaryPixelSizes:s}=t,r=s?.[0],o=r??(n?{x:n.width/e.width,y:n.height/e.height}:{x:1,y:1});return(0,v.M_)(e,{resolution:o})}};(0,i._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],_.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({type:m,json:{write:!0,name:"rasterFunctionArguments"}})],_.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],_.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],_.prototype,"isGCS",void 0),_=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.AspectFunction")],_);const C=_;var A=n(36030),P=n(35454);const R=new Set(["+","-","*","/","(",")"]);function N(t,e,n,s){if("number"==typeof n&&"number"==typeof s)return n+s;let r,o,i;"number"==typeof n?(i=s,r=i.length,o=new Float32Array(r),o.fill(n)):(r=n.length,o=n,s.constructor===Number?(i=new Float32Array(r),i.fill(s)):i=s);const a=new Float32Array(r);switch(e){case"+":for(let e=0;e<r;e++)(null==t||t[e])&&(a[e]=o[e]+i[e]);break;case"-":for(let e=0;e<r;e++)(null==t||t[e])&&(a[e]=o[e]-i[e]);break;case"*":for(let e=0;e<r;e++)(null==t||t[e])&&(a[e]=o[e]*i[e]);break;case"/":for(let e=0;e<r;e++)(null==t||t[e])&&i[e]&&(a[e]=o[e]/i[e]);break;case"(":case")":throw new Error("encountered error with custom band index equation")}return a}function T(t,e){t.splice(e,1);let n=0,s=0;do{n=0,s=0;for(let e=0;e<t.length;e++)if("("===t[e])n=e;else if(")"===t[e]){s=e;break}s===n+1&&t.splice(n,2)}while(s===n+1);return t}function I(t){if(1===t.length)return{opIndex:0,numIndex:0};let e=0,n=0;for(let s=0;s<t.length;s++)if("("===t[s])e=s;else if(")"===t[s]){n=s;break}const s=0===n?t:t.slice(e+1,n);let r=-1;for(let t=0;t<s.length;t++)if("*"===s[t]||"/"===s[t]){r=t;break}if(r>-1)n>0&&(r+=e+1);else{for(let t=0;t<s.length;t++)if("+"===s[t]||"-"===s[t]){r=t;break}n>0&&(r+=e+1)}let o=0;for(let e=0;e<r;e++)"("===t[e]&&o++;return{opIndex:r,numIndex:r-o}}var F=n(55914);const j=new P.X({0:"custom",1:"ndvi",2:"savi",3:"tsavi",4:"msavi",5:"gemi",6:"pvi",7:"gvitm",8:"sultan",9:"vari",10:"gndvi",11:"sr",12:"ndvi-re",13:"sr-re",14:"mtvi2",15:"rtvi-core",16:"ci-re",17:"ci-g",18:"ndwi",19:"evi",20:"iron-oxide",21:"ferrous-minerals",22:"clay-minerals",23:"wndwi",24:"bai",25:"nbr",26:"ndbi",27:"ndmi",28:"ndsi",29:"mndwi"},{useNumericKeys:!0});function k(t,e){if(!(0,F.nk)(t))return t;const{equation:n,method:s}=e,r=e.bandIndexes.map((t=>t-1)),{pixels:o,mask:i}=t;let a;switch(s){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":a=M(i,o[r[0]],o[r[1]]);break;case"ndwi":a=M(i,o[r[1]],o[r[0]]);break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":a=function(t,e,n){const s=n.length,r=new Float32Array(s);for(let o=0;o<s;o++)if(null==t||t[o]){const t=e[o],s=n[o];s&&(r[o]=t/s)}return[r]}(i,o[r[0]],o[r[1]]);break;case"ci-g":case"ci-re":a=function(t,e,n){const s=e.length,r=new Float32Array(s);for(let o=0;o<s;o++)if(null==t||t[o]){const t=e[o],s=n[o];s&&(r[o]=t/s-1)}return[r]}(i,o[r[0]],o[r[1]]);break;case"savi":a=function(t,e,n,s){const r=n.length,o=new Float32Array(r);for(let i=0;i<r;i++)if(null==t||t[i]){const t=n[i],r=e[i],a=r+t+s;a&&(o[i]=(r-t)/a*(1+s))}return[o]}(i,o[r[0]],o[r[1]],r[2]+1);break;case"tsavi":a=function(t,e,n,s,r,o){const i=n.length,a=new Float32Array(i),u=-r*s+o*(1+s*s);for(let o=0;o<i;o++)if(null==t||t[o]){const t=n[o],i=e[o],l=r*i+t+u;l&&(a[o]=s*(i-s*t-r)/l)}return[a]}(i,o[r[0]],o[r[1]],r[2]+1,r[3]+1,r[4]+1);break;case"msavi":a=function(t,e,n){const s=n.length,r=new Float32Array(s);for(let o=0;o<s;o++)if(null==t||t[o]){const t=n[o],s=e[o];r[o]=.5*(2*(s+1)-Math.sqrt((2*s+1)**2-8*(s-t)))}return[r]}(i,o[r[0]],o[r[1]]);break;case"gemi":a=function(t,e,n){const s=n.length,r=new Float32Array(s);for(let o=0;o<s;o++)if(null==t||t[o]){const t=n[o],s=e[o];if(1!==t){const e=(2*(s*s-t*t)+1.5*s+.5*t)/(s+t+.5);r[o]=e*(1-.25*e)-(t-.125)/(1-t)}}return[r]}(i,o[r[0]],o[r[1]]);break;case"pvi":a=function(t,e,n,s,r){const o=n.length,i=new Float32Array(o),a=Math.sqrt(1+s*s);for(let u=0;u<o;u++)if(null==t||t[u]){const t=n[u],o=e[u];i[u]=(o-s*t-r)/a}return[i]}(i,o[r[0]],o[r[1]],r[2]+1,r[3]+1);break;case"gvitm":a=function(t,e){const[n,s,r,o,i,a]=e,u=n.length,l=new Float32Array(u);for(let e=0;e<u;e++)(null==t||t[e])&&(l[e]=-.2848*n[e]-.2435*s[e]-.5436*r[e]+.7243*o[e]+.084*i[e]-1.18*a[e]);return[l]}(i,[o[r[0]],o[r[1]],o[r[2]],o[r[3]],o[r[4]],o[r[5]]]);break;case"sultan":a=function(t,e){const[n,,s,r,o,i]=e,a=n.length,u=new Float32Array(a),l=new Float32Array(a),c=new Float32Array(a);for(let e=0;e<a;e++)(null==t||t[e])&&(u[e]=i[e]?o[e]/i[e]*100:0,l[e]=n[e]?o[e]/n[e]*100:0,c[e]=r[e]?s[e]/r[e]*(o[e]/r[e])*100:0);return[u,l,c]}(i,[o[r[0]],o[r[1]],o[r[2]],o[r[3]],o[r[4]],o[r[5]]]);break;case"vari":a=function(t,e){const[n,s,r]=e,o=n.length,i=new Float32Array(o);for(let e=0;e<o;e++)if(null==t||t[e])for(e=0;e<o;e++){const t=n[e],o=s[e],a=o+t-r[e];a&&(i[e]=(o-t)/a)}return[i]}(i,[o[r[0]],o[r[1]],o[r[2]]]);break;case"mtvi2":a=function(t,e){const[n,s,r]=e,o=n.length,i=new Float32Array(o);for(let e=0;e<o;e++)if(null==t||t[e])for(e=0;e<o;e++){const t=n[e],o=s[e],a=r[e],u=Math.sqrt((2*t+1)**2-6*t-5*Math.sqrt(o)-.5);i[e]=1.5*(1.2*(t-a)-2.5*(o-a))*u}return[i]}(i,[o[r[0]],o[r[1]],o[r[2]]]);break;case"rtvi-core":a=function(t,e){const[n,s,r]=e,o=n.length,i=new Float32Array(o);for(let e=0;e<o;e++)if(null==t||t[e])for(e=0;e<o;e++){const t=n[e],o=s[e],a=r[e];i[e]=100*(t-o)-10*(t-a)}return[i]}(i,[o[r[0]],o[r[1]],o[r[2]]]);break;case"evi":a=function(t,e){const[n,s,r]=e,o=n.length,i=new Float32Array(o);for(let e=0;e<o;e++)if(null==t||t[e])for(e=0;e<o;e++){const t=n[e],o=s[e],a=t+6*o-7.5*r[e]+1;a&&(i[e]=2.5*(t-o)/a)}return[i]}(i,[o[r[0]],o[r[1]],o[r[2]]]);break;case"wndwi":a=function(t,e,n=.5){const[s,r,o]=e,i=r.length,a=new Float32Array(i);for(let e=0;e<i;e++)if(null==t||t[e])for(e=0;e<i;e++){const t=s[e],i=r[e],u=o[e],l=t+n*i+(1-n)*u;l&&(a[e]=(t-n*i-(1-n)*u)/l)}return[a]}(i,[o[r[0]],o[r[1]],o[r[2]]],r[3]?r[3]+1:.5);break;case"bai":a=function(t,e,n){const s=n.length,r=new Float32Array(s);for(let o=0;o<s;o++)if(null==t||t[o])for(o=0;o<s;o++){const t=(.1-e[o])**2+(.06-n[o])**2;t&&(r[o]=1/t)}return[r]}(i,o[r[0]],o[r[1]]);break;case"custom":a=function(t,e,n){let s,{ops:r,nums:o}=function(t,e){(t=t.replaceAll(" ","")).startsWith("-")&&(t="0"+t),t.startsWith("+")&&(t=t.slice(1,t.length));const n=t.split(""),s=[],r=[];let o="";for(let t=0;t<n.length;t++){const i=n[t];if(R.has(i))""!==o&&r.push(parseFloat(o)),s.push(i),o="";else{if("b"===i.toLowerCase()){t++,o=i.concat(n[t]),r.push(e[parseInt(o[1],10)-1]),o="";continue}o=o.concat(i),t===n.length-1&&r.push(parseFloat(o))}}return{ops:s,nums:r}}(n,e);if(0===r.length){const t=1===o.length?o[0]:e[0];if(t instanceof Float32Array)return[t];const n=new Float32Array(e[0].length);return"number"==typeof t?n.fill(t):n.set(t),[n]}for(;r.length>0;){const{numIndex:e,opIndex:n}=I(r);if(s=N(t,r[n],o[e],o[e+1]),1===r.length)break;r=T(r,n),o.splice(e,2,s)}return[s]}(i,o,n);break;default:return t}const u=null!=i?new Uint8Array(i.length):null;null!=i&&null!=u&&u.set(i);const l=new g.Z({width:t.width,height:t.height,pixelType:"f32",pixels:a,mask:u});return l.updateStatistics(),l}function S(t){const e=new Float32Array(9);return e[3*t[0]]=1,e[3*t[1]+1]=1,e[3*t[2]+2]=1,e}function M(t,e,n){const s=n.length,r=new Float32Array(s);for(let o=0;o<s;o++)if(null==t||t[o]){const t=e[o],s=n[o],i=t+s;i&&(r[o]=(t-s)/i)}return[r]}var B;let G=B=class extends p{constructor(){super(...arguments),this.method="custom"}clone(){return new B({method:this.method,bandIndexes:this.bandIndexes,raster:(0,o.d9)(this.raster)})}};(0,i._)([(0,a.Cb)({json:{type:String,write:!0}})],G.prototype,"bandIndexes",void 0),(0,i._)([(0,A.J)(j)],G.prototype,"method",void 0),G=B=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.BandArithmeticFunctionArguments")],G);const E=G,D=new Set(["vari","mtvi2","rtvi-core","evi"]);let O=class extends w{constructor(){super(...arguments),this.functionName="BandArithmetic",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const t=this.sourceRasterInfos[0];if(t.bandCount<2)return{success:!1,supportsGPU:!1,error:"band-arithmetic-function: source raster has insufficient amount of raster bands"};const e=t.clone();return e.pixelType=this.outputPixelType,e.statistics=null,e.histograms=null,e.bandCount="sultan"===this.functionArguments.method?3:1,e.keyProperties={...e.keyProperties,BandProperties:void 0},this.rasterInfo=e,{success:!0,supportsGPU:!["custom","gvitm","sultan"].includes(this.functionArguments.method)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return e;const{method:n,bandIndexes:s}=this.functionArguments,r=s.split(" ").map((t=>parseFloat(t)));return k(e,{method:n,bandIndexes:r,equation:s})}_getWebGLParameters(){const t=this.functionArguments.bandIndexes.split(" ").map((t=>parseFloat(t)-1));2===t.length&&t.push(0);const e=this.isInputBandIdsSwizzled?[0,1,2]:t;let n,s;const r=new Float32Array(3),{method:o}=this.functionArguments;switch(o){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":n=S([e[0],e[1],0]),s="ndxi";break;case"ndwi":n=S([e[1],e[0],0]),s="ndxi";break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":n=S([e[0],e[1],0]),s="sr";break;case"ci-g":case"ci-re":n=S([e[0],e[1],0]),s="ci";break;case"savi":n=S([e[0],e[1],0]),s="savi",r[0]=t[2]+1;break;case"tsavi":n=S([e[0],e[1],0]),s="tsavi",r[0]=t[2]+1,r[1]=t[3]+1,r[2]=t[4]+1;break;case"msavi":n=S([e[0],e[1],0]),s="msavi";break;case"gemi":n=S([e[0],e[1],0]),s="gemi";break;case"pvi":n=S([e[0],e[1],0]),s="tsavi",r[0]=t[2]+1,r[1]=t[3]+1;break;case"vari":n=S([e[0],e[1],e[2]]),s="vari";break;case"mtvi2":n=S([e[0],e[1],e[2]]),s="mtvi2";break;case"rtvi-core":n=S([e[0],e[1],e[2]]),s="rtvicore";break;case"evi":n=S([e[0],e[1],e[2]]),s="evi";break;case"wndwi":n=S([e[0],e[1],0]),s="wndwi",r[0]=t[3]?t[3]+1:.5;break;case"bai":n=S([e[1],e[0],0]),s="bai";break;default:n=S([0,1,2]),s="custom"}return{bandIndexMat3:n,indexType:s,adjustments:r}}_getInputBandIds(t){if("custom"===this.functionArguments.method)return t;const e=this.functionArguments.bandIndexes.split(" ").map((t=>parseFloat(t)-1)),n=t.length,s=e.map((t=>t>=n?n-1:t)),r=D.has(this.functionArguments.method)?3:2,o=s.slice(0,r).map((e=>t[e]));return 2===o.length&&o.push(0),o}};(0,i._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],O.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({type:E,json:{write:!0,name:"rasterFunctionArguments"}})],O.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],O.prototype,"rasterArgumentNames",void 0),O=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.BandArithmeticFunction")],O);const z=O;var Z,V=n(71715),L=n(93010),W=n(94593);let U=Z=class extends p{castColormapName(t){if(!t)return null;const e=t.toLowerCase();return L.Oi.includes(e)?e:null}readColorRamp(t){return(0,W.i)(t)}readColorRampName(t,e){if(!t)return null;const n=L.H0.jsonValues.find((e=>e.toLowerCase()===t.toLowerCase()));return n?L.H0.fromJSON(n):null}clone(){return new Z({colormap:(0,o.d9)(this.colormap),colormapName:this.colormapName,colorRamp:this.colorRamp?.clone(),colorRampName:this.colorRampName})}};(0,i._)([(0,a.Cb)({type:[[Number]],json:{write:!0}})],U.prototype,"colormap",void 0),(0,i._)([(0,a.Cb)({type:String,json:{write:!0}})],U.prototype,"colormapName",void 0),(0,i._)([(0,d.p)("colormapName")],U.prototype,"castColormapName",null),(0,i._)([(0,a.Cb)({types:W.V,json:{write:!0}})],U.prototype,"colorRamp",void 0),(0,i._)([(0,V.r)("colorRamp")],U.prototype,"readColorRamp",null),(0,i._)([(0,a.Cb)({type:L.H0.apiValues,json:{type:L.H0.jsonValues,write:L.H0.write}})],U.prototype,"colorRampName",void 0),(0,i._)([(0,V.r)("colorRampName")],U.prototype,"readColorRampName",null),U=Z=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.ColormapFunctionArguments")],U);const q=U,X=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[112,75,3],[113,76,3],[114,77,3],[115,77,3],[116,78,3],[117,79,3],[118,79,3],[119,80,3],[121,81,4],[122,82,4],[123,82,4],[124,83,4],[125,84,4],[126,84,4],[127,85,4],[128,86,4],[129,86,4],[130,87,4],[131,88,4],[132,89,4],[133,89,4],[134,90,4],[135,91,4],[136,91,4],[137,92,4],[138,93,4],[139,94,4],[140,94,4],[142,95,5],[143,96,5],[144,96,5],[145,97,5],[146,98,5],[147,99,5],[148,99,5],[149,100,5],[150,101,5],[151,101,5],[152,102,5],[153,103,5],[154,104,5],[155,104,5],[156,105,5],[157,106,5],[158,106,5],[159,107,5],[160,108,5],[161,108,5],[162,109,5],[164,110,6],[165,111,6],[166,111,6],[167,112,6],[168,113,6],[169,113,6],[170,114,6],[171,115,6],[172,116,6],[173,116,6],[174,117,6],[245,0,0],[245,5,0],[245,10,0],[246,15,0],[246,20,0],[246,25,0],[246,30,0],[247,35,0],[247,40,0],[247,45,0],[247,50,0],[247,55,0],[248,60,0],[248,65,0],[248,70,0],[248,75,0],[249,81,0],[249,86,0],[249,91,0],[249,96,0],[250,101,0],[250,106,0],[250,111,0],[250,116,0],[250,121,0],[251,126,0],[251,131,0],[251,136,0],[251,141,0],[252,146,0],[252,151,0],[252,156,0],[252,156,0],[251,159,0],[250,162,0],[249,165,0],[248,168,0],[247,171,0],[246,174,0],[245,177,0],[245,179,0],[244,182,0],[243,185,0],[242,188,0],[241,191,0],[240,194,0],[239,197,0],[238,200,0],[237,203,0],[236,206,0],[235,209,0],[234,212,0],[233,215,0],[232,218,0],[231,221,0],[230,224,0],[230,226,0],[229,229,0],[228,232,0],[227,235,0],[226,238,0],[225,241,0],[224,244,0],[223,247,0],[165,247,0],[163,244,0],[161,240,0],[158,237,0],[156,233,1],[154,230,1],[152,227,1],[149,223,1],[147,220,1],[145,216,1],[143,213,1],[140,210,2],[138,206,2],[136,203,2],[134,200,2],[132,196,2],[129,193,2],[127,189,2],[125,186,3],[123,183,3],[120,179,3],[118,176,3],[116,172,3],[114,169,3],[111,166,3],[109,162,4],[107,159,4],[105,155,4],[103,152,4],[100,149,4],[98,145,4],[96,142,4],[94,138,5],[91,135,5],[89,132,5],[87,128,5],[85,125,5],[82,121,5],[80,118,5],[78,115,6],[76,111,6],[73,108,6],[71,105,6],[69,101,6],[67,98,6],[65,94,6],[62,91,7],[60,88,7],[58,84,7],[56,81,7],[53,77,7],[51,74,7],[49,71,7],[47,67,8],[44,64,8],[42,60,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8]],J=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[245,20,0],[245,24,0],[245,29,0],[245,31,0],[247,33,0],[247,33,0],[247,37,0],[247,41,0],[247,41,0],[247,41,0],[247,45,0],[247,45,0],[247,47,0],[247,49,0],[247,49,0],[247,54,0],[247,54,0],[247,56,0],[247,58,0],[247,58,0],[250,62,0],[250,62,0],[250,62,0],[250,67,0],[250,67,0],[250,67,0],[250,69,0],[250,71,0],[250,71,0],[250,75,0],[250,75,0],[250,78,0],[250,79,0],[250,79,0],[250,79,0],[250,81,0],[250,83,0],[250,83,0],[250,87,0],[250,87,0],[250,90,0],[250,92,0],[252,93,0],[252,93,0],[252,97,0],[252,97,0],[252,97,0],[252,97,0],[252,101,0],[252,101,0],[252,101,0],[252,101,0],[252,105,0],[252,105,0],[252,107,0],[252,109,0],[252,109,0],[252,113,13],[255,118,20],[255,119,23],[255,121,25],[255,126,33],[255,132,38],[255,133,40],[255,135,43],[255,141,48],[255,144,54],[255,150,59],[255,152,61],[255,153,64],[255,159,69],[255,163,77],[255,165,79],[255,168,82],[255,174,87],[255,176,92],[255,181,97],[255,183,99],[255,186,102],[255,191,107],[255,197,115],[255,201,120],[255,203,123],[255,205,125],[255,209,130],[255,214,138],[255,216,141],[255,218,143],[255,224,150],[255,228,156],[255,234,163],[255,236,165],[255,238,168],[255,243,173],[255,248,181],[255,252,186],[253,252,186],[250,252,187],[244,250,180],[238,247,176],[234,246,173],[231,245,169],[223,240,163],[217,237,157],[211,235,150],[205,233,146],[200,230,142],[195,227,136],[189,224,132],[184,222,126],[180,220,123],[174,217,119],[169,214,114],[163,212,108],[160,210,105],[154,207,101],[148,204,96],[143,201,93],[138,199,88],[134,197,84],[130,194,81],[126,191,77],[117,189,70],[115,186,68],[112,184,64],[106,181,60],[100,179,55],[94,176,49],[92,174,47],[90,173,45],[81,168,37],[75,166,33],[71,163,28],[66,160,24],[62,158,21],[56,156,14],[51,153,0],[51,153,0],[51,153,0],[50,150,0],[50,150,0],[50,150,0],[50,150,0],[49,148,0],[49,148,0],[49,148,0],[48,145,0],[48,145,0],[48,145,0],[48,145,0],[48,143,0],[48,143,0],[48,143,0],[48,143,0],[47,140,0],[47,140,0],[47,140,0],[47,140,0],[46,138,0],[46,138,0],[46,138,0],[46,138,0],[45,135,0],[45,135,0],[45,135,0],[45,135,0],[44,133,0],[44,133,0],[44,133,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[42,128,0],[42,128,0],[42,128,0],[42,125,0],[42,125,0],[42,125,0],[42,125,0],[41,122,0],[41,122,0],[41,122,0],[41,122,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[39,117,0],[39,117,0],[39,117,0],[39,117,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0]];function H(t,e){const n=[],s=[];for(let e=0;e<t.length-1;e++)n.push({type:"algorithmic",algorithm:"esriHSVAlgorithm",fromColor:t[e].slice(1),toColor:t[e+1].slice(1)}),s.push(t[e+1][0]-t[e][0]);const r=t.at(-1)[0];return(0,L.XL)({type:"multipart",colorRamps:n},{numColors:r,weights:e=e??s})}let $=class extends w{constructor(){super(...arguments),this.functionName="Colormap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,supportsGPU:!1,error:"colormap-function: source data must be single band"};let{colormap:e,colormapName:n,colorRamp:s,colorRampName:r}=this.functionArguments;if(!e?.length)if(s)e=(0,L.Jw)(s,{interpolateAlpha:!0});else if(r){const t=(0,L.B4)(r);t&&(e=(0,L.Jw)(t))}else n&&(e=function(t){let e;switch(t){case"elevation":e=H([[0,0,191,191],[51,0,0,255],[102,255,0,255],[153,255,0,127],[204,191,63,127],[256,20,20,20]]);break;case"gray":e=(0,L.XL)({type:"algorithmic",algorithm:"esriHSVAlgorithm",fromColor:[0,0,0],toColor:[255,255,255]});break;case"hillshade":e=H([[0,38,41,54],[69,79,82,90],[131,156,156,156],[256,253,253,241]],[.268,.238,.495]);break;case"ndvi":e=X;break;case"ndvi2":e=function(){const t=H([[0,255,255,255],[70,0,255,0],[80,205,173,193],[100,150,150,150],[110,120,51,100],[130,120,100,200],[140,28,3,144],[160,6,0,55],[180,10,25,30],[201,6,7,27]]);for(let e=t.length;e<256;e++)t.push([6,27,7]);return t}();break;case"ndvi3":e=J;break;case"random":e=function(){const t=[];for(let e=0;e<256;e++){const e=[];for(let t=0;t<3;t++)e.push(Math.round(255*Math.random()));t.push(e)}return t}()}return e?(e=e.map(((t,e)=>[e,...t])),e):null}(n));if(!e?.length)return{success:!1,supportsGPU:!1,error:"colormap-function: missing colormap argument"};this.outputPixelType=this._getOutputPixelType("u8");const o=t.clone();return o.pixelType=this.outputPixelType,o.colormap=e,o.bandCount=1,this.rasterInfo=o,{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}};(0,i._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],$.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({type:q,json:{write:!0,name:"rasterFunctionArguments"}})],$.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],$.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.Cb)()],$.prototype,"isNoopProcess",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],$.prototype,"indexedColormap",void 0),$=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.ColormapFunction")],$);const Y=$;var K,Q=n(30556);let tt=K=class extends p{constructor(){super(...arguments),this.rasters=[]}writeRasters(t,e){e.rasters=t.map((t=>"number"==typeof t||"string"==typeof t?t:t.toJSON()))}clone(){return new K({rasters:(0,o.d9)(this.rasters)})}};(0,i._)([(0,a.Cb)({json:{write:!0}})],tt.prototype,"rasters",void 0),(0,i._)([(0,Q.c)("rasters")],tt.prototype,"writeRasters",null),tt=K=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.CompositeBandFunctionArguments")],tt);const et=tt;let nt=class extends w{constructor(){super(...arguments),this.functionName="CompositeBand",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0];this.outputPixelType=this._getOutputPixelType(e.pixelType);const n=e.clone();if(n.attributeTable=null,n.colormap=null,n.pixelType=this.outputPixelType,n.bandCount=t.map((({bandCount:t})=>t)).reduce(((t,e)=>t+e)),t.every((({statistics:t})=>null!=t&&t.length))){const e=[];t.forEach((({statistics:t})=>null!=t&&e.push(...t))),n.statistics=e}if(t.every((({histograms:t})=>null!=t&&t.length))){const e=[];t.forEach((({histograms:t})=>null!=t&&e.push(...t))),n.histograms=e}n.bandCount>1&&(n.colormap=null,n.attributeTable=null);const s=t.every((t=>t.keyProperties.BandProperties?.length))?t.flatMap((t=>t.keyProperties.BandProperties)):void 0;return n.keyProperties={...n.keyProperties,BandProperties:s},this.rasterInfo=n,{success:!0,supportsGPU:n.bandCount<=3}}_processPixels(t){const{pixelBlocks:e}=t;if(!e)return null;const n=e?.[0];return null==n?null:(0,F.Gd)(e)}_getWebGLParameters(){return{bandCount:this.rasterInfo.bandCount}}};(0,i._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],nt.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({type:et,json:{write:!0,name:"rasterFunctionArguments"}})],nt.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],nt.prototype,"rasterArgumentNames",void 0),nt=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.CompositeBandFunction")],nt);const st=nt,rt={userDefined:-1,lineDetectionHorizontal:0,lineDetectionVertical:1,lineDetectionLeftDiagonal:2,lineDetectionRightDiagonal:3,gradientNorth:4,gradientWest:5,gradientEast:6,gradientSouth:7,gradientNorthEast:8,gradientNorthWest:9,smoothArithmeticMean:10,smoothing3x3:11,smoothing5x5:12,sharpening3x3:13,sharpening5x5:14,laplacian3x3:15,laplacian5x5:16,sobelHorizontal:17,sobelVertical:18,sharpen:19,sharpen2:20,pointSpread:21,none:255},ot={bitwiseAnd:11,bitwiseLeftShift:12,bitwiseNot:13,bitwiseOr:14,bitwiseRightShift:15,bitwiseXOr:16,booleanAnd:17,booleanNot:18,booleanOr:19,booleanXOr:20,equalTo:24,greaterThan:28,greaterThanEqual:29,lessThan:33,lessThanEqual:34,isNull:31,notEqual:46},it={acos:6,asin:7,atan:8,atanh:9,cos:21,cosh:22,sin:51,sinh:52,tan:56,tanh:57,acosh:59,asinh:60,atan2:61},at={setNull:50,conditional:78},ut={plus:1,minus:2,times:3,sqrt:4,power:5,abs:10,divide:23,exp:25,exp10:26,exp2:27,int:30,float:32,ln:35,log10:36,log2:37,mod:44,negate:45,roundDown:48,roundUp:49,square:53,floatDivide:64,floorDivide:65,...ot,...it,majority:38,max:39,mean:40,med:41,min:42,minority:43,range:47,stddev:54,sum:55,variety:58,majorityIgnoreNoData:66,maxIgnoreNoData:67,meanIgnoreNoData:68,medIgnoreNoData:69,minIgnoreNoData:70,minorityIgnoreNoData:71,rangeIgnoreNoData:72,stddevIgnoreNoData:73,sumIgnoreNoData:74,varietyIgnoreNoData:75,...at};var lt=n(81578);const ct=new Map;function pt(t,e,n,s,r,o,i){const a=new Float32Array(e*n),u=o.length,l=i?0:s,c=i?s:0,p=i?1:e;for(let i=l;i<n-l;i++){const n=i*e;for(let i=c;i<e-c;i++){if(r&&!r[n+i])continue;let e=0;for(let r=0;r<u;r++)e+=t[n+i+(r-s)*p]*o[r];a[n+i]=e}}return a}function ft(t,e,n,s,r,o,i){const a=new Float32Array(e*n),u=Math.floor(s/2),l=Math.floor(r/2);for(let c=u;c<n-u;c++){const n=c*e;for(let c=l;c<e-l;c++){if(o&&!o[n+c])continue;let p=0;for(let o=0;o<s;o++)for(let s=0;s<r;s++)p+=t[n+c+(o-u)*e+s-l]*i[o*r+s];a[n+c]=p}}return a}function ht(t,e,n,s,r){const o=Math.floor(s/2);for(let s=0;s<o;s++)for(let o=0;o<e;o++)t[s*e+o]=t[(r-1-s)*e+o],t[(n-1-s)*e+o]=t[(n-r+s)*e+o];const i=Math.floor(r/2);for(let s=0;s<n;s++){const n=s*e;for(let s=0;s<i;s++)t[n+s]=t[n+r-1-s],t[n+e-s-1]=t[n+e+s-r]}}var mt;ct.set(rt.none,[0,0,0,0,1,0,0,0,0]),ct.set(rt.lineDetectionHorizontal,[-1,-1,-1,2,2,2,-1,-1,-1]),ct.set(rt.lineDetectionVertical,[-1,2,-1,-1,2,-1,-1,2,-1]),ct.set(rt.lineDetectionLeftDiagonal,[2,-1,-1,-1,2,-1,-1,-1,2]),ct.set(rt.lineDetectionRightDiagonal,[-1,-1,2,-1,2,-1,2,-1,-1]),ct.set(rt.gradientNorth,[-1,-2,-1,0,0,0,1,2,1]),ct.set(rt.gradientWest,[-1,0,1,-2,0,2,-1,0,1]),ct.set(rt.gradientEast,[1,0,-1,2,0,-2,1,0,-1]),ct.set(rt.gradientSouth,[1,2,1,0,0,0,-1,-2,-1]),ct.set(rt.gradientNorthEast,[0,-1,-2,1,0,-1,2,1,0]),ct.set(rt.gradientNorthWest,[-2,-1,0,-1,0,1,0,1,2]),ct.set(rt.smoothArithmeticMean,[.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111]),ct.set(rt.smoothing3x3,[.0625,.125,.0625,.125,.25,.125,.0625,.125,.0625]),ct.set(rt.smoothing5x5,[1,1,1,1,1,1,4,4,4,1,1,4,12,4,1,1,4,4,4,1,1,1,1,1,1]),ct.set(rt.sharpening3x3,[-1,-1,-1,-1,9,-1,-1,-1,-1]),ct.set(rt.sharpening5x5,[-1,-3,-4,-3,-1,-3,0,6,0,-3,-4,6,21,6,-4,-3,0,6,0,-3,-1,-3,-4,-3,-1]),ct.set(rt.laplacian3x3,[0,-1,0,-1,4,-1,0,-1,0]),ct.set(rt.laplacian5x5,[0,0,-1,0,0,0,-1,-2,-1,0,-1,-2,17,-2,-1,0,-1,-2,-1,0,0,0,-1,0,0]),ct.set(rt.sobelHorizontal,[-1,-2,-1,0,0,0,1,2,1]),ct.set(rt.sobelVertical,[-1,0,1,-2,0,2,-1,0,1]),ct.set(rt.sharpen,[0,-.25,0,-.25,2,-.25,0,-.25,0]),ct.set(rt.sharpen2,[-.25,-.25,-.25,-.25,3,-.25,-.25,-.25,-.25]),ct.set(rt.pointSpread,[-.627,.352,-.627,.352,2.923,.352,-.627,.352,-.627]);let dt=mt=class extends p{constructor(){super(...arguments),this.rows=3,this.cols=3,this.kernel=[0,0,0,0,1,0,0,0,0]}set convolutionType(t){this._set("convolutionType",t);const e=ct.get(t);if(!e||t===rt.userDefined||t===rt.none)return;const n=Math.sqrt(e.length);this._set("kernel",e),this._set("cols",n),this._set("rows",n)}clone(){return new mt({cols:this.cols,rows:this.rows,kernel:[...this.kernel],convolutionType:this.convolutionType,raster:(0,o.d9)(this.raster)})}};(0,i._)([(0,a.Cb)({json:{type:Number,write:!0}})],dt.prototype,"rows",void 0),(0,i._)([(0,a.Cb)({json:{type:Number,write:!0}})],dt.prototype,"cols",void 0),(0,i._)([(0,a.Cb)({json:{name:"type",type:Number,write:!0}})],dt.prototype,"convolutionType",null),(0,i._)([(0,a.Cb)({json:{type:[Number],write:!0}})],dt.prototype,"kernel",void 0),dt=mt=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.ConvolutionFunctionArguments")],dt);const gt=dt;let yt=class extends w{constructor(){super(...arguments),this.functionName="Convolution",this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{convolutionType:t,rows:e,cols:n,kernel:s}=this.functionArguments;if(!Object.values(rt).includes(t))return{success:!1,supportsGPU:!1,error:`convolution-function: the specified kernel type is not supported ${t}`};if(t!==rt.none&&e*n!==s.length)return{success:!1,supportsGPU:!1,error:"convolution-function: the specified rows and cols do not match the length of the kernel"};const r=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(r.pixelType);const o=r.clone();o.pixelType=this.outputPixelType;const i=[rt.none,rt.sharpen,rt.sharpen2,rt.sharpening3x3,rt.sharpening5x5];return"u8"===this.outputPixelType||i.includes(t)||(o.statistics=null,o.histograms=null),o.colormap=null,o.attributeTable=null,this.rasterInfo=o,{success:!0,supportsGPU:s.length<=25}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e||this.functionArguments.convolutionType===rt.none)return e;let{kernel:n,rows:s,cols:r}=this.functionArguments;const o=n.reduce(((t,e)=>t+e));return 0!==o&&1!==o&&(n=n.map((t=>t/o))),function(t,e){const n=function(t){const e=Math.sqrt(t.length),n=t.slice(0,e),s=[1];for(let n=1;n<e;n++){let r=null;for(let s=0;s<e;s++){const o=t[s+n*e],i=t[s];if(null==r)if(0===i){if(o)return{separable:!1,row:null,col:null}}else r=o/i;else if(o/i!==r)return{separable:!1,row:null,col:null}}if(null==r)return{separable:!1,row:null,col:null};s.push(r)}return{separable:!0,row:n,col:s}}(e.kernel),s=!1!==e.mirrorEdges,r=n.separable?function(t,e,n,s=!0){const{pixels:r,width:o,height:i,pixelType:a,mask:u}=t,l=r.length,c=[],p=e.length,f=n.length,h=Math.floor(p/2),m=Math.floor(f/2);for(let t=0;t<l;t++){let a=pt(r[t],o,i,h,u,e,!0);a=pt(a,o,i,m,u,n,!1),s&&ht(a,o,i,p,f),c.push(a)}return new g.Z({width:o,height:i,pixelType:a,pixels:c,mask:u})}(t,n.row,n.col,s):function(t,e,n=!0){const{pixels:s,width:r,height:o,pixelType:i,mask:a}=t,u=s.length,l=[],{kernel:c,rows:p,cols:f}=e;for(let t=0;t<u;t++){const e=ft(s[t],r,o,p,f,a,c);n&&ht(e,r,o,p,f),l.push(e)}return new g.Z({width:r,height:o,pixelType:i,pixels:l,mask:a})}(t,e,s),{outputPixelType:o}=e;return o&&r.clamp(o),r}(e,{kernel:n,rows:s,cols:r,outputPixelType:this.outputPixelType})}_getWebGLParameters(){let{kernel:t}=this.functionArguments;const e=t.reduce(((t,e)=>t+e));0!==e&&1!==e&&(t=t.map((t=>t/e)));const n=new Float32Array(25);return n.set(t),{kernelRows:this.functionArguments.rows,kernelCols:this.functionArguments.cols,kernel:n,clampRange:(0,lt.r)(this.outputPixelType)}}};(0,i._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],yt.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({type:gt,json:{write:!0,name:"rasterFunctionArguments"}})],yt.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],yt.prototype,"rasterArgumentNames",void 0),yt=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.ConvolutionFunction")],yt);const bt=yt;var xt;const wt=new P.X({0:"standard",1:"platform",2:"profile"},{useNumericKeys:!0});let vt=xt=class extends p{constructor(){super(...arguments),this.curvatureType="standard",this.zFactor=1}readCurvatureType(t,e){return wt.fromJSON(e.type??e.curvatureType??0)}clone(){return new xt({curvatureType:this.curvatureType,zFactor:this.zFactor,raster:this.raster})}};(0,i._)([(0,a.Cb)({json:{write:{target:"type"}}}),(0,A.J)(wt)],vt.prototype,"curvatureType",void 0),(0,i._)([(0,V.r)("curvatureType",["type","curvatureType"])],vt.prototype,"readCurvatureType",null),(0,i._)([(0,a.Cb)({type:Number,json:{write:!0}})],vt.prototype,"zFactor",void 0),vt=xt=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.CurvatureFunctionArguments")],vt);const _t=vt;let Ct=class extends w{constructor(){super(...arguments),this.functionName="Curvature",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const t=this.sourceRasterInfos[0].clone();return t.pixelType=this.outputPixelType,t.statistics=null,t.histograms=null,t.colormap=null,t.attributeTable=null,t.bandCount=1,this.rasterInfo=t,this.isGCS=t.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{zFactor:n,curvatureType:s}=this.functionArguments,{extent:r,primaryPixelSizes:o}=t,i=o?.[0],a=i??(r?{x:r.width/e.width,y:r.height/e.height}:{x:1,y:1}),u=this.isGCS&&n>=1?n*v.CX:n;return(0,v.Ne)(e,{zFactor:u,curvatureType:s,resolution:a})}_getWebGLParameters(){const{zFactor:t,curvatureType:e}=this.functionArguments;return{curvatureType:e,zFactor:this.isGCS&&t>=1?t*v.CX:t}}};(0,i._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],Ct.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({type:_t,json:{write:!0,name:"rasterFunctionArguments"}})],Ct.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],Ct.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],Ct.prototype,"isGCS",void 0),Ct=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.CurvatureFunction")],Ct);const At=Ct;var Pt;let Rt=Pt=class extends p{constructor(){super(...arguments),this.bandIds=[],this.bandNames=[],this.bandWavelengths=[],this.missingBandAction=F.CD.bestMatch}clone(){return new Pt({bandIds:[...this.bandIds],bandNames:[...this.bandNames],missingBandAction:this.missingBandAction,method:this.method,wavelengthMatchTolerance:this.wavelengthMatchTolerance})}};(0,i._)([(0,a.Cb)({json:{write:!0}})],Rt.prototype,"bandIds",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],Rt.prototype,"bandNames",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],Rt.prototype,"bandWavelengths",void 0),(0,i._)([(0,A.J)({0:"name",1:"wavelength",2:"id"})],Rt.prototype,"method",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],Rt.prototype,"missingBandAction",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],Rt.prototype,"wavelengthMatchTolerance",void 0),Rt=Pt=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.ExtractBandFunctionArguments")],Rt);const Nt=Rt;let Tt=class extends w{constructor(){super(...arguments),this.functionName="ExtractBand",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{functionArguments:t,sourceRasterInfos:e}=this,n=e[0],{method:s,bandNames:r,bandWavelengths:o,bandIds:i,missingBandAction:a}=t,u=r?.length&&("name"===s||"id"!==s&&!i?.length),l=o?.length&&("wavelength"===s||"id"!==s&&!i?.length),c=a===F.CD.fail,p=u?this._matchBandNames(n,r):l?this._matchBandWavelengths(n,o,c):this._matchBandIds(n,i,c);if(null==p)return{success:!1,supportsGPU:!1,error:`extract-band-function: Invalid ${u?"band names":l?"band wavelengths":"band ids"} for the imagery data source`};this.functionArguments.bandIds=p,this.functionArguments.method="id",this.outputPixelType=this._getOutputPixelType("f32");const f=n.clone();f.pixelType=this.outputPixelType,f.bandCount=p.length;const{statistics:h,histograms:m}=f;null!=h&&h.length&&(f.statistics=p.map((t=>h[t]||h.at(-1)))),null!=m&&m.length&&(f.histograms=p.map((t=>m[t]||m.at(-1))));let d=f.keyProperties?.BandProperties;return d?.length&&(d=p.map((t=>t>=d.length?d.at(-1):d[t])),f.keyProperties={...f.keyProperties,BandProperties:d}),this.rasterInfo=f,{success:!0,supportsGPU:f.bandCount<=3}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const n=e.pixels.length,s=this.functionArguments.bandIds.map((t=>t>=n?n-1:t));return e.extractBands(s)}_getWebGLParameters(){let t;if(this.isInputBandIdsSwizzled)t=this.swizzledBandSelection.length?this.swizzledBandSelection:[0,1,2];else{t=[...this.functionArguments.bandIds],0===t.length?t=[0,1,2]:t.length<3&&(t[1]=t[1]??t[0],t[2]=t[2]??t[1]);for(let e=0;e<3;e++)t[e]=Math.min(t[e],2)}return{bandIndexMat3:S(t)}}_getInputBandIds(t){const e=t.length;return this.functionArguments.bandIds.map((t=>t>=e?e-1:t)).map((e=>t[e]))}_matchBandNames(t,e){const n=t.bandInfos.map((({name:t})=>t.toLowerCase())),s=[];for(let t=0;t<e.length;t++){const r=e[t].toLowerCase();let o=n.indexOf(r);if(-1===o&&"nearinfrared"===r&&(o=n.findIndex((t=>t.startsWith("nearinfrared_1"))),-1===o&&(o=n.findIndex((t=>t.startsWith("nearinfrared"))))),-1===o)return null;s.push(o)}return s}_matchBandIds(t,e,n){const{bandCount:s}=t;return!e?.length||n&&e.some((t=>t<0||t>=s))?null:e}_matchBandWavelengths(t,e,n){const{bandInfos:s}=t,r=[];for(let t=0;t<s.length;t++){const{minWavelength:e,maxWavelength:n}=s[t];if(!e||!n)return null;r.push({minWavelength:e,maxWavelength:n})}const{wavelengthMatchTolerance:o}=this.functionArguments,i=[];for(let t=0;t<e.length;t++){const s=e[t];let a=!1,u=-1,l=Number.MAX_VALUE;for(let t=0;t<r.length;t++){const e=r[t],n=s>=e.minWavelength&&s<=e.maxWavelength,o=Math.abs(s-(e.minWavelength+e.maxWavelength)/2);n?o<l&&(a=!0,u=t,l=o):!a&&o<l&&(u=t,l=o)}if(!a&&o&&l<o&&(a=!0),!a&&n)return null;i.push(u)}return i}};(0,i._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],Tt.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({type:Nt,json:{write:!0,name:"rasterFunctionArguments"}})],Tt.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],Tt.prototype,"rasterArgumentNames",void 0),Tt=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.ExtractBandFunction")],Tt);const It=Tt;var Ft;let jt=Ft=class extends p{constructor(){super(...arguments),this.rasters=[],this.processAsMultiband=!0}writeRasters(t,e){e.rasters=t.map((t=>"number"==typeof t||"string"==typeof t?t:t.toJSON()))}clone(){return new Ft({operation:this.operation,processAsMultiband:this.processAsMultiband,rasters:(0,o.d9)(this.rasters)})}};(0,i._)([(0,a.Cb)({json:{write:!0}})],jt.prototype,"operation",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],jt.prototype,"rasters",void 0),(0,i._)([(0,Q.c)("rasters")],jt.prototype,"writeRasters",null),(0,i._)([(0,a.Cb)({json:{write:!0}})],jt.prototype,"processAsMultiband",void 0),jt=Ft=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.LocalFunctionArguments")],jt);const kt=jt,St=new Map;St.set(it.acos,[0,Math.PI]),St.set(it.asin,[-Math.PI/2,Math.PI/2]),St.set(it.atan,[-Math.PI/2,Math.PI/2]),St.set(it.cos,[-1,1]),St.set(it.sin,[-1,1]),St.set(ot.booleanAnd,[0,1]),St.set(ot.booleanNot,[0,1]),St.set(ot.booleanOr,[0,1]),St.set(ot.booleanXOr,[0,1]),St.set(ot.equalTo,[0,1]),St.set(ot.notEqual,[0,1]),St.set(ot.greaterThan,[0,1]),St.set(ot.greaterThanEqual,[0,1]),St.set(ot.lessThan,[0,1]),St.set(ot.lessThanEqual,[0,1]),St.set(ot.isNull,[0,1]);const Mt=[0,2,2,2,1,2,1,1,1,1,1,2,2,1,2,2,2,2,1,2,2,1,1,2,2,1,1,1,2,2,1,1,1,2,2,1,1,1,999,999,999,999,999,999,2,1,2,999,1,1,2,1,1,1,999,999,1,1,999,1,1,2,999,999,2,2,999,999,999,999,999,999,999,999,999,999,3,999,3];function Bt(t,e,n){const[s,r]=t,o=s.length,i=g.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]+r[t]);return i}function Gt(t,e,n){const[s]=t,r=s.length,o=g.Z.createEmptyBand("f32",r);return o.set(s),o}function Et(t,e,n){const[s,r]=t,o=s.length,i=g.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]-r[t]);return i}function Dt(t,e,n){const[s,r]=t,o=s.length,i=g.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]*r[t]);return i}function Ot(t,e,n){const[s]=t,r=s.length,o=g.Z.createEmptyBand(n,r);for(let t=0;t<r;t++)e&&!e[t]||(o[t]=Math.sign(s[t])*Math.floor(Math.abs(s[t])));return o}function zt(t,e,n){const[s,r]=t,o=s.length,i=g.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]/r[t]);return i}function Zt(t,e,n){return zt(t,e,"f32")}function Vt(t,e,n){const[s,r]=t,o=s.length,i=g.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=Math.floor(s[t]/r[t]));return i}function Lt(t,e,n,s){const r=t[0],o=r.length,i=g.Z.createEmptyBand(n,o);if(s===it.atanh){for(let t=0;t<o;t++)if(e[t]){const n=r[t];Math.abs(n)>=1?e[t]=0:i[t]=Math.atanh(n)}return i}const a=s===it.asin?Math.asin:Math.acos;for(let t=0;t<o;t++)if(e[t]){const n=r[t];Math.abs(n)>1?e[t]=0:i[t]=a(n)}return i}function Wt(t,e,n,s){const[r]=t,o=r.length,i=g.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s(r[t]));return i}function Ut(t,e,n,s){const[r,o]=t,i=r.length,a=g.Z.createEmptyBand(n,i);for(let t=0;t<i;t++)e&&!e[t]||(a[t]=s(r[t],o[t]));return a}function qt(t,e,n){const[s,r]=t,o=s.length,i=g.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]&r[t]);return i}function Xt(t,e,n){const[s,r]=t,o=s.length,i=g.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]<<r[t]);return i}function Jt(t,e,n){const[s]=t,r=s.length,o=g.Z.createEmptyBand(n,r);for(let t=0;t<r;t++)e&&!e[t]||(o[t]=~s[t]);return o}function Ht(t,e,n){const[s,r]=t,o=s.length,i=g.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]|r[t]);return i}function $t(t,e,n){const[s,r]=t,o=s.length,i=g.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]>>r[t]);return i}function Yt(t,e,n){const[s,r]=t,o=s.length,i=g.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]^r[t]);return i}function Kt(t,e,n){const[s,r]=t,o=s.length,i=g.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]&&r[t]?1:0);return i}function Qt(t,e,n){const[s]=t,r=s.length,o=g.Z.createEmptyBand(n,r);for(let t=0;t<r;t++)e&&!e[t]||(o[t]=s[t]?0:1);return o}function te(t,e,n){const[s,r]=t,o=s.length,i=g.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]||r[t]?1:0);return i}function ee(t,e,n){const[s,r]=t,o=s.length,i=g.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=(s[t]?1:0)^(r[t]?1:0));return i}function ne(t,e,n){const[s,r]=t,o=s.length,i=g.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]===r[t]?1:0);return i}function se(t,e,n,s){const[r]=t,o=r.length,i=g.Z.createEmptyBand(n,o),a=s===Math.E;for(let t=0;t<o;t++)e&&!e[t]||(i[t]=a?Math.exp(r[t]):s**r[t]);return i}function re(t,e,n){return se(t,e,n,10)}function oe(t,e,n){return se(t,e,n,2)}function ie(t,e,n){return se(t,e,n,Math.E)}function ae(t,e,n,s){const[r]=t,o=r.length,i=g.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(r[t]<=0?e[t]=0:i[t]=s(r[t]));return i}function ue(t,e,n){return ae(t,e,n,Math.log10)}function le(t,e,n){return ae(t,e,n,Math.log2)}function ce(t,e,n){return ae(t,e,n,Math.log)}function pe(t,e,n){const[s,r]=t,o=s.length,i=g.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]>r[t]?1:0);return i}function fe(t,e,n){const[s,r]=t,o=s.length,i=g.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]>=r[t]?1:0);return i}function he(t,e,n){const[s,r]=t,o=s.length,i=g.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]<r[t]?1:0);return i}function me(t,e,n){const[s,r]=t,o=s.length,i=g.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]<=r[t]?1:0);return i}function de(t,e,n){const[s]=t,r=s.length,o=g.Z.createEmptyBand(n,r);if(!e)return o;for(let t=0;t<r;t++)o[t]=e[t]?0:1;return o}function ge(t,e,n){const[s,r]=t,o=s.length,i=g.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]%r[t]);return i}function ye(t,e,n){const[s]=t,r=s.length,o=g.Z.createEmptyBand(n,r);for(let t=0;t<r;t++)e&&!e[t]||(o[t]=-s[t]);return o}function be(t,e,n){const[s,r]=t,o=s.length,i=g.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]===r[t]?0:1);return i}function xe(t,e,n){const[s,r]=t,o=s.length,i=g.Z.createEmptyBand(n,o),a=new Uint8Array(o);for(let t=0;t<o;t++)null!=e&&!e[t]||0!==s[t]||(i[t]=r[t],a[t]=255);return{band:i,mask:a}}function we(t,e,n){const[s,r,o]=t,i=s.length,a=g.Z.createEmptyBand(n,i);for(let t=0;t<i;t++)e&&!e[t]||(a[t]=s[t]?r[t]:o[t]);return a}function ve(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=g.Z.createEmptyBand(n,o);for(let n=0;n<o;n++)if(!e||e[n]){let e=r[n];for(let r=1;r<s;r++){const s=t[r][n];e<s&&(e=s)}i[n]=e}return i}function _e(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=g.Z.createEmptyBand(n,o);for(let n=0;n<o;n++)if(!e||e[n]){let e=r[n];for(let r=1;r<s;r++){const s=t[r][n];e>s&&(e=s)}i[n]=e}return i}function Ce(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=g.Z.createEmptyBand(n,o);for(let n=0;n<o;n++)if(!e||e[n]){let e=r[n],o=e;for(let r=1;r<s;r++){const s=t[r][n];o<s?o=s:e>s&&(e=s)}i[n]=o-e}return i}function Ae(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=g.Z.createEmptyBand(n,o);for(let n=0;n<o;n++)if(!e||e[n]){let e=0;for(let r=0;r<s;r++)e+=t[r][n];i[n]=e/s}return i}function Pe(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=g.Z.createEmptyBand(n,o);for(let n=0;n<o;n++)if(!e||e[n])for(let e=0;e<s;e++){const s=t[e];i[n]+=s[n]}return i}function Re(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=g.Z.createEmptyBand(n,o);for(let n=0;n<o;n++)if(!e||e[n]){const e=new Float32Array(s);let r=0;for(let o=0;o<s;o++){const s=t[o];r+=s[n],e[o]=s[n]}r/=s;let o=0;for(let t=0;t<s;t++)o+=(e[t]-r)**2;i[n]=Math.sqrt(o/s)}return i}function Ne(t,e,n){const s=t.length;if(s<2)return t[0];const r=Math.floor(s/2),[o]=t,i=o.length,a=g.Z.createEmptyBand(n,i),u=new Float32Array(s),l=s%2==1;for(let n=0;n<i;n++)if(!e||e[n]){for(let e=0;e<s;e++)u[e]=t[e][n];u.sort(),a[n]=l?u[r]:(u[r]+u[r-1])/2}return a}function Te(t,e,n){const[s,r]=t;if(null==r)return s;const o=s.length,i=g.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e[t]&&(s[t]===r[t]?i[t]=s[t]:e[t]=0);return i}function Ie(t,e,n){const s=t.length;if(s<=2)return Te(t,e,n);const r=t[0].length,o=g.Z.createEmptyBand(n,r),i=new Map;for(let n=0;n<r;n++)if(!e||e[n]){let e;i.clear();for(let r=0;r<s;r++)e=t[r][n],i.set(e,i.has(e)?i.get(e)+1:1);let r=0,a=0;for(const t of i.keys())r=i.get(t),r>a&&(a=r,e=t);o[n]=e}return o}function Fe(t,e,n){const s=t.length;if(s<=2)return Te(t,e,n);const r=t[0].length,o=g.Z.createEmptyBand(n,r),i=new Map;for(let n=0;n<r;n++)if(!e||e[n]){let e;i.clear();for(let r=0;r<s;r++)e=t[r][n],i.set(e,i.has(e)?i.get(e)+1:1);let r=0,a=t.length;for(const t of i.keys())r=i.get(t),r<a&&(a=r,e=t);o[n]=e}return o}function je(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=g.Z.createEmptyBand(n,o),a=new Set;for(let n=0;n<o;n++)if(!e||e[n]){let e;a.clear();for(let r=0;r<s;r++)e=t[r][n],a.add(e);i[n]=a.size}return i}const ke=new Map,Se=new Map,Me=new Map,Be=new Map;function Ge(t,e,n,s){let[r,o]=(0,lt.r)(n);const i=n.startsWith("u")||n.startsWith("s");i&&(r-=1e-5,o+=1e-5);for(let n=0;n<e.length;n++)if(e[n]){const a=t[n];isNaN(a)||a<r||a>o?e[n]=0:s[n]=i?Math.round(a):a}}let Ee=class extends w{constructor(){super(...arguments),this.functionName="Local",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0],{bandCount:n}=e,{processAsMultiband:s}=this.functionArguments;if(t.some((t=>t.bandCount!==n)))return{success:!1,supportsGPU:!1,error:"local-function: input rasters do not have same band count"};const{operation:r,rasters:o}=this.functionArguments,i=Mt[r];if(!(999===i||o.length===i||o.length<=1&&1===i))return{success:!1,supportsGPU:!1,error:`local-function: the length of functionArguments.rasters does not match operation's requirement: ${i}`};this.outputPixelType=this._getOutputPixelType("f32");const a=e.clone();a.pixelType=this.outputPixelType,a.statistics=null,a.histograms=null,a.colormap=null,a.attributeTable=null,a.bandCount=999!==i||s?n:1;const u=function(t){return St.get(t)}(r);if(u){a.statistics=[];for(let t=0;t<a.bandCount;t++)a.statistics[t]={min:u[0],max:u[1],avg:(u[0]+u[1])/2,stddev:(u[0]+u[1])/10}}return this.rasterInfo=a,{success:!0,supportsGPU:1===a.bandCount&&i<=3&&(r<11||r>16)}}_processPixels(t){const{pixelBlocks:e}=t;return null==e||e.some((t=>null==t))?null:function(t,e,n={}){ke.size||(ke.set(4,Math.sqrt),ke.set(6,Math.acos),ke.set(7,Math.asin),ke.set(8,Math.atan),ke.set(9,Math.atanh),ke.set(10,Math.abs),ke.set(21,Math.cos),ke.set(22,Math.cosh),ke.set(48,Math.floor),ke.set(49,Math.ceil),ke.set(51,Math.sin),ke.set(52,Math.sinh),ke.set(56,Math.tan),ke.set(57,Math.tanh),ke.set(59,Math.acosh),ke.set(60,Math.asinh),ke.set(65,Math.floor),Se.set(5,Math.pow),Se.set(61,Math.atan2),Me.set(1,Bt),Me.set(2,Et),Me.set(3,Dt),Me.set(11,qt),Me.set(12,Xt),Me.set(12,Xt),Me.set(13,Jt),Me.set(14,Ht),Me.set(15,$t),Me.set(16,Yt),Me.set(17,Kt),Me.set(18,Qt),Me.set(19,te),Me.set(20,ee),Me.set(23,zt),Me.set(24,ne),Me.set(25,ie),Me.set(26,re),Me.set(27,oe),Me.set(28,pe),Me.set(29,fe),Me.set(30,Ot),Me.set(31,de),Me.set(32,Gt),Me.set(33,he),Me.set(34,me),Me.set(35,ce),Me.set(36,ue),Me.set(37,le),Me.set(44,ge),Me.set(45,ye),Me.set(46,be),Me.set(64,Zt),Me.set(65,Vt),Me.set(76,we),Me.set(78,we),Be.set(38,Ie),Be.set(39,ve),Be.set(40,Ae),Be.set(41,Ne),Be.set(42,_e),Be.set(43,Fe),Be.set(47,Ce),Be.set(54,Re),Be.set(55,Pe),Be.set(58,je),Be.set(66,Ie),Be.set(67,ve),Be.set(68,Ae),Be.set(69,Ne),Be.set(70,_e),Be.set(71,Fe),Be.set(72,Ce),Be.set(73,Re),Be.set(74,Pe),Be.set(75,je));let s=function(t,e=!1){const n=t.map((t=>t.mask)),s=n.filter((t=>null!=t)),r=t[0].pixels[0].length;if(0===s.length)return new Uint8Array(r).fill(255);const o=s[0],i=new Uint8Array(o);if(1===s.length)return i;if(!e){for(let t=1;t<s.length;t++){const e=s[t];for(let t=0;t<i.length;t++)i[t]&&(i[t]=e[t]?255:0)}return i}if(s.length!==n.length)return new Uint8Array(r).fill(255);for(let t=1;t<s.length;t++){const e=s[t];for(let t=0;t<i.length;t++)0===i[t]&&(i[t]=e[t]?255:0)}return i}(t,e>=66&&e<=75);const{outputPixelType:r="f32"}=n,o=!Be.has(e)||n.processAsMultiband,i=o?t[0].pixels.length:1,a=[];for(let n=0;n<i;n++){const i=Be.has(e)&&!o?t.flatMap((t=>t.pixels)):t.map((t=>t.pixels[n]));let u,l=!0;if(e===at.setNull){const t=xe(i,s,r);u=t.band,s=t.mask,l=!1}else Me.has(e)?u=Me.get(e)(i,s,"f64"):ke.has(e)?u=e===it.asin||e===it.acos||e===it.atanh?Lt(i,s,"f64",e):Wt(i,s,"f64",ke.get(e)):Se.has(e)?u=Ut(i,s,"f64",Se.get(e)):Be.has(e)?u=Be.get(e)(i,s,"f64"):(u=i[0],l=!1);if(l&&e!==ot.isNull&&!St.has(e)){const t=g.Z.createEmptyBand(r,u.length);s||(s=new Uint8Array(u.length).fill(255)),Ge(u,s,r,t),u=t}a.push(u)}const u=t[0];return new g.Z({width:u.width,height:u.height,pixelType:r,mask:e===ot.isNull?null:s,pixels:a})}(e,this.functionArguments.operation,{processAsMultiband:this.functionArguments.processAsMultiband,outputPixelType:this.outputPixelType??void 0})}_getWebGLParameters(){const{operation:t}=this.functionArguments,e=Mt[t],n=Object.keys(ut).find((e=>ut[e]===t))?.toLowerCase()??"undefined",s=this.outputPixelType??"f32";let[r,o]=(0,lt.r)(s);const i=s.startsWith("u")||s.startsWith("s");return i&&(r-=1e-4,o+=1e-4),{imageCount:e,operationName:n,domainRange:[r,o],isOutputRounded:i}}};(0,i._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],Ee.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({type:kt,json:{write:!0,name:"rasterFunctionArguments"}})],Ee.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],Ee.prototype,"rasterArgumentNames",void 0),Ee=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.LocalFunction")],Ee);const De=Ee;var Oe,ze=n(22021);let Ze=Oe=class extends p{constructor(){super(...arguments),this.includedRanges=null,this.noDataValues=null,this.noDataInterpretation=F.DX.matchAny}get normalizedNoDataValues(){const{noDataValues:t}=this;if(!t?.length)return null;let e=!1;const n=t.map((t=>{if("number"==typeof t)return e=!0,[t];if("string"==typeof t){const n=t.trim().split(" ").filter((t=>""!==t.trim())).map((t=>Number(t)));return e=e||n.length>0,0===n.length?null:n}return null}));return e?n:null}clone(){return new Oe({includedRanges:this.includedRanges?.slice()??[],noDataValues:this.noDataValues?.slice()??[],noDataInterpretation:this.noDataInterpretation})}};(0,i._)([(0,a.Cb)({json:{write:!0}})],Ze.prototype,"includedRanges",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],Ze.prototype,"noDataValues",void 0),(0,i._)([(0,a.Cb)()],Ze.prototype,"normalizedNoDataValues",null),(0,i._)([(0,a.Cb)({json:{write:!0}})],Ze.prototype,"noDataInterpretation",void 0),Ze=Oe=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.MaskFunctionArguments")],Ze);const Ve=Ze;let Le=class extends w{constructor(){super(...arguments),this.functionName="Mask",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;this.outputPixelType=this._getOutputPixelType(e),t.pixelType=this.outputPixelType,this.rasterInfo=t;const{includedRanges:n,normalizedNoDataValues:s}=this.functionArguments;if(!n?.length&&!s?.length)return{success:!1,supportsGPU:!1,error:"missing includedRanges or noDataValues argument"};let r=[];for(let o=0;o<t.bandCount;o++){const t=(0,F.nA)(e,n?.slice(2*o,2*o+2),s?.[o]);if(null==t){r=null;break}r.push(t)}this.lookups=r;const o=null!=s&&s.every((t=>t?.length===s[0]?.length));return{success:!0,supportsGPU:(!n||n.length<=2*F.hd)&&(!s||o&&s[0].length<=F.hd)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{outputPixelType:n,lookups:s}=this,{includedRanges:r,noDataInterpretation:o,normalizedNoDataValues:i}=this.functionArguments,a=o===F.DX.matchAll;return(0,F.sS)(e,{includedRanges:r,noDataValues:i,outputPixelType:n,matchAll:a,lookups:s})}_getWebGLParameters(){const{includedRanges:t,normalizedNoDataValues:e}=this.functionArguments,n=new Float32Array(F.hd);n.fill(ze._3),e?.[0]?.length&&n.set(e[0]);const s=new Float32Array(F.hd);for(let e=0;e<s.length;e+=2)s[e]=t?.[e]??-ze._3,s[e+1]=t?.[e+1]??ze._3;return t&&t.length&&s.set(t),{bandCount:this.sourceRasterInfos[0].bandCount,noDataValues:n,includedRanges:s}}};(0,i._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],Le.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({type:Ve,json:{write:!0,name:"rasterFunctionArguments"}})],Le.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],Le.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],Le.prototype,"lookups",void 0),Le=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.MaskFunction")],Le);const We=Le;var Ue;let qe=Ue=class extends p{constructor(){super(...arguments),this.visibleBandID=0,this.infraredBandID=1,this.scientificOutput=!1}clone(){const{visibleBandID:t,infraredBandID:e,scientificOutput:n}=this;return new Ue({visibleBandID:t,infraredBandID:e,scientificOutput:n})}};(0,i._)([(0,a.Cb)({json:{write:!0}})],qe.prototype,"visibleBandID",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],qe.prototype,"infraredBandID",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],qe.prototype,"scientificOutput",void 0),qe=Ue=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.NDVIFunctionArguments")],qe);const Xe=qe;let Je=class extends w{constructor(){super(...arguments),this.functionName="NDVI",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{scientificOutput:t,visibleBandID:e,infraredBandID:n}=this.functionArguments;this.outputPixelType=this._getOutputPixelType(t?"f32":"u8");const s=this.sourceRasterInfos[0],r=Math.max(e,n);if(s.bandCount<2||r>=s.bandCount)return{success:!1,supportsGPU:!1,error:"ndvi-function: source raster has insufficient amount of raster bands"};const o=s.clone();o.pixelType=this.outputPixelType,o.colormap=null,o.histograms=null,o.bandCount=1,o.keyProperties={...o.keyProperties,BandProperties:void 0};const[i,a,u,l]=t?[-1,1,0,.1]:[0,200,100,10];return o.statistics=[{min:i,max:a,avg:u,stddev:l}],this.rasterInfo=o,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{visibleBandID:n,infraredBandID:s,scientificOutput:r}=this.functionArguments;return function(t,e,n,s){const{mask:r,pixels:o,width:i,height:a}=t,u=o[n],l=o[e],c=l.length,p=s?new Uint8Array(c):new Float32Array(c),f=s?100:1,h=s?100.5:0;for(let t=0;t<c;t++)if(null==r||r[t]){const e=u[t],n=l[t],s=e+n;s&&(p[t]=(e-n)/s*f+h)}const m=new g.Z({width:i,height:a,mask:r,pixelType:s?"u8":"f32",pixels:[p]});return m.updateStatistics(),m}(e,n,s,!r)}_getWebGLParameters(){const{visibleBandID:t,infraredBandID:e,scientificOutput:n}=this.functionArguments;return{bandIndexMat3:S(this.isInputBandIdsSwizzled?[0,1,2]:[e,t,0]),scaled:!n}}_getInputBandIds(t){const{visibleBandID:e,infraredBandID:n}=this.functionArguments;return[n,e,0].map((e=>t[e]))}};(0,i._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],Je.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({type:Xe,json:{write:!0,name:"rasterFunctionArguments"}})],Je.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],Je.prototype,"rasterArgumentNames",void 0),Je=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.NDVIFunction")],Je);const He=Je;var $e;let Ye=$e=class extends p{constructor(){super(...arguments),this.inputRanges=null,this.outputValues=null,this.noDataRanges=null,this.allowUnmatched=!1,this.isLastInputRangeInclusive=!1}clone(){return new $e({inputRanges:[...this.inputRanges],outputValues:[...this.outputValues],noDataRanges:[...this.noDataRanges],allowUnmatched:this.allowUnmatched,isLastInputRangeInclusive:this.isLastInputRangeInclusive})}};(0,i._)([(0,a.Cb)({json:{write:!0}})],Ye.prototype,"inputRanges",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],Ye.prototype,"outputValues",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],Ye.prototype,"noDataRanges",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],Ye.prototype,"allowUnmatched",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],Ye.prototype,"isLastInputRangeInclusive",void 0),Ye=$e=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.RemapFunctionArguments")],Ye);const Ke=Ye;let Qe=class extends w{constructor(){super(...arguments),this.functionName="Remap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;this.outputPixelType=this._getOutputPixelType(e),t.pixelType=this.outputPixelType,t.colormap=null,t.histograms=null,t.bandCount=1,t.attributeTable=null;const{statistics:n}=t,{allowUnmatched:s,outputValues:r,inputRanges:o,noDataRanges:i,isLastInputRangeInclusive:a}=this.functionArguments;if(null!=n&&n.length&&r?.length)if(s){const e=Math.min.apply(null,[...r,n[0].min]),s=Math.max.apply(null,[...r,n[0].max]);t.statistics=[{...n[0],min:e,max:s}]}else{let e=r[0],s=e;for(let t=0;t<r.length;t++)e=e>r[t]?r[t]:e,s=s>r[t]?s:r[t];t.statistics=[{...n[0],min:e,max:s}]}return this.rasterInfo=t,this.lookup=s?null:(0,F.oB)({srcPixelType:e,inputRanges:o,outputValues:r,noDataRanges:i,allowUnmatched:s,isLastInputRangeInclusive:a,outputPixelType:this.outputPixelType}),{success:!0,supportsGPU:(!r||r.length<=F.hd)&&(!i||i.length<=F.hd)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{lookup:n,outputPixelType:s}=this;if(n){const t=(0,F.XV)(e,{lut:[n.lut],offset:n.offset,outputPixelType:s});return null!=t&&n.mask&&(t.mask=(0,F.wV)(e.pixels[0],e.mask,n.mask,n.offset,"u8")),t}const{inputRanges:r,outputValues:o,noDataRanges:i,allowUnmatched:a,isLastInputRangeInclusive:u}=this.functionArguments;return(0,F.a2)(e,{inputRanges:r,outputValues:o,noDataRanges:i,outputPixelType:s,allowUnmatched:a,isLastInputRangeInclusive:u})}_getWebGLParameters(){const{allowUnmatched:t,noDataRanges:e,isLastInputRangeInclusive:n}=this.functionArguments,s=new Float32Array(3*F.hd),r=1e-5,o=this.functionArguments.inputRanges??[],i=this.functionArguments.outputValues??[],a=i.length;for(let t=0;t<F.hd;t++)s[3*t]=o[2*t]??ze._3-1,s[3*t+1]=o[2*t+1]??ze._3,s[3*t+2]=i[t]??0,t<a&&(t>0&&(s[3*t]-=r),(t<a-1||!n)&&(s[3*t+1]-=r));const u=new Float32Array(2*F.hd);return u.fill(ze._3),e?.length&&u.set(e),{allowUnmatched:t,rangeMaps:s,noDataRanges:u,clampRange:(0,lt.r)(this.outputPixelType)}}};(0,i._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],Qe.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({type:Ke,json:{write:!0,name:"rasterFunctionArguments"}})],Qe.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],Qe.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],Qe.prototype,"lookup",void 0),Qe=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.RemapFunction")],Qe);const tn=Qe;var en;const nn=new P.X({1:"degree",2:"percent-rise",3:"adjusted"},{useNumericKeys:!0});let sn=en=class extends p{constructor(){super(...arguments),this.slopeType="degree",this.zFactor=1,this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.removeEdgeEffect=!1}clone(){return new en({slopeType:this.slopeType,zFactor:this.zFactor,pixelSizePower:this.pixelSizePower,pixelSizeFactor:this.pixelSizeFactor,removeEdgeEffect:this.removeEdgeEffect,raster:this.raster})}};(0,i._)([(0,A.J)(nn)],sn.prototype,"slopeType",void 0),(0,i._)([(0,a.Cb)({type:Number,json:{write:!0}})],sn.prototype,"zFactor",void 0),(0,i._)([(0,a.Cb)({type:Number,json:{name:"psPower",write:!0}})],sn.prototype,"pixelSizePower",void 0),(0,i._)([(0,a.Cb)({type:Number,json:{name:"psZFactor",write:!0}})],sn.prototype,"pixelSizeFactor",void 0),(0,i._)([(0,a.Cb)({type:Boolean,json:{write:!0}})],sn.prototype,"removeEdgeEffect",void 0),sn=en=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.SlopeFunctionArguments")],sn);const rn=sn;let on=class extends w{constructor(){super(...arguments),this.functionName="Slope",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const t=this.sourceRasterInfos[0].clone();return t.pixelType=this.outputPixelType,t.statistics="percent-rise"!==this.functionArguments.slopeType?[{min:0,max:90,avg:1,stddev:1}]:null,t.histograms=null,t.colormap=null,t.attributeTable=null,t.bandCount=1,this.rasterInfo=t,this.isGCS=t.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{zFactor:n,slopeType:s,pixelSizePower:r,pixelSizeFactor:o}=this.functionArguments,{isGCS:i}=this,{extent:a,primaryPixelSizes:u}=t,l=u?.[0],c=l??(a?{x:a.width/e.width,y:a.height/e.height}:{x:1,y:1});return(0,v.yg)(e,{zFactor:n,slopeType:s,pixelSizePower:r,pixelSizeFactor:o,isGCS:i,resolution:c})}_getWebGLParameters(){const{zFactor:t,slopeType:e,pixelSizeFactor:n,pixelSizePower:s}=this.functionArguments;return{zFactor:this.isGCS&&t>=1?t*v.CX:t,slopeType:e,pixelSizeFactor:n??0,pixelSizePower:s??0}}};(0,i._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],on.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({type:rn,json:{write:!0,name:"rasterFunctionArguments"}})],on.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],on.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],on.prototype,"isGCS",void 0),on=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.SlopeFunction")],on);const an=on;var un;let ln=un=class extends p{constructor(){super(...arguments),this.statistics=null,this.histograms=null}readStatistics(t,e){if(!t?.length)return null;const n=[];return t.forEach((t=>{const e={min:t.min,max:t.max,avg:t.avg??t.mean,stddev:t.stddev??t.standardDeviation};n.push(e)})),n}writeStatistics(t,e,n){if(!t?.length)return;const s=[];t.forEach((t=>{const e={...t,mean:t.avg,standardDeviation:t.stddev};delete e.avg,delete e.stddev,s.push(e)})),e[n]=s}clone(){return new un({statistics:(0,o.d9)(this.statistics),histograms:(0,o.d9)(this.histograms)})}};(0,i._)([(0,a.Cb)({json:{write:!0}})],ln.prototype,"statistics",void 0),(0,i._)([(0,V.r)("statistics")],ln.prototype,"readStatistics",null),(0,i._)([(0,Q.c)("statistics")],ln.prototype,"writeStatistics",null),(0,i._)([(0,a.Cb)({json:{write:!0}})],ln.prototype,"histograms",void 0),ln=un=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.StatisticsHistogramFunctionArguments")],ln);const cn=ln;let pn=class extends w{constructor(){super(...arguments),this.functionName="StatisticsHistogram",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType("u8");const e=t.clone(),{statistics:n,histograms:s}=this.functionArguments;return s&&(e.histograms=s),n&&(e.statistics=n),this.rasterInfo=e,{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}};(0,i._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],pn.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({type:cn,json:{write:!0,name:"rasterFunctionArguments"}})],pn.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],pn.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],pn.prototype,"indexedColormap",void 0),(0,i._)([(0,a.Cb)()],pn.prototype,"isNoopProcess",void 0),pn=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.StatisticsHistogramFunction")],pn);const fn=pn;var hn;const mn=new P.X({0:"none",3:"standard-deviation",4:"histogram-equalization",5:"min-max",6:"percent-clip",9:"sigmoid"},{useNumericKeys:!0});let dn=hn=class extends p{constructor(){super(...arguments),this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.histograms=null,this.statistics=null,this.stretchType="none",this.useGamma=!1}writeStatistics(t,e,n){t?.length&&(Array.isArray(t[0])||(t=t.map((t=>[t.min,t.max,t.avg,t.stddev]))),e[n]=t)}clone(){return new hn({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:(0,o.d9)(this.statistics),gamma:(0,o.d9)(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,histograms:(0,o.d9)(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment,raster:this.raster})}};(0,i._)([(0,a.Cb)({type:Boolean,json:{write:!0}})],dn.prototype,"computeGamma",void 0),(0,i._)([(0,a.Cb)({type:Boolean,json:{name:"dra",write:!0}})],dn.prototype,"dynamicRangeAdjustment",void 0),(0,i._)([(0,a.Cb)({type:[Number],json:{write:!0}})],dn.prototype,"gamma",void 0),(0,i._)([(0,a.Cb)()],dn.prototype,"histograms",void 0),(0,i._)([(0,a.Cb)({type:Number,json:{write:!0}})],dn.prototype,"maxPercent",void 0),(0,i._)([(0,a.Cb)({type:Number,json:{write:!0}})],dn.prototype,"minPercent",void 0),(0,i._)([(0,a.Cb)({type:Number,json:{write:!0}})],dn.prototype,"numberOfStandardDeviations",void 0),(0,i._)([(0,a.Cb)({type:Number,json:{name:"max",write:!0}})],dn.prototype,"outputMax",void 0),(0,i._)([(0,a.Cb)({type:Number,json:{name:"min",write:!0}})],dn.prototype,"outputMin",void 0),(0,i._)([(0,a.Cb)({type:Number,json:{write:!0}})],dn.prototype,"sigmoidStrengthLevel",void 0),(0,i._)([(0,a.Cb)({json:{type:[[Number]],write:!0}})],dn.prototype,"statistics",void 0),(0,i._)([(0,Q.c)("statistics")],dn.prototype,"writeStatistics",null),(0,i._)([(0,A.J)(mn)],dn.prototype,"stretchType",void 0),(0,i._)([(0,a.Cb)({type:Boolean,json:{write:!0}})],dn.prototype,"useGamma",void 0),dn=hn=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.StretchFunctionArguments")],dn);const gn=dn;var yn=n(15612);let bn=class extends w{constructor(){super(...arguments),this.functionName="Stretch",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null,this.cutOffs=null}_bindSourceRasters(){this.lookup=null,this.cutOffs=null;const t=this.sourceRasterInfos[0],{pixelType:e}=t,{functionArguments:n}=this,{dynamicRangeAdjustment:s,gamma:r,useGamma:o}=n;if(!s&&["u8","u16","s8","s16"].includes(e)){const s=(0,yn.AV)(n.toJSON(),{rasterInfo:t}),i=this._isOutputRoundingNeeded()?"round":"float";this.lookup=(0,yn.hE)({pixelType:e,...s,gamma:o?r:null,rounding:i}),this.cutOffs=s}else s||(this.cutOffs=(0,yn.AV)(n.toJSON(),{rasterInfo:t}));this.outputPixelType=this._getOutputPixelType(e);const i=t.clone();return i.pixelType=this.outputPixelType,i.statistics=null,i.histograms=null,i.colormap=null,i.attributeTable=null,"u8"===this.outputPixelType&&(i.keyProperties.DataType="processed"),this.rasterInfo=i,{success:!0,supportsGPU:!s}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return e;const{lookup:n}=this;if(n)return(0,F.XV)(e,{...n,outputPixelType:this.rasterInfo.pixelType});const{functionArguments:s}=this,r=this.cutOffs||(0,yn.AV)(s.toJSON(),{rasterInfo:this.sourceRasterInfos[0],pixelBlock:e}),o=s.useGamma?s.gamma:null;return(0,yn.dy)(e,{...r,gamma:o,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const{outputMin:t=0,outputMax:e=255,gamma:n,useGamma:s}=this.functionArguments,r=this.rasterInfo.bandCount>=2?3:1,o=s&&n&&n.length?(0,yn.um)(r,n):[1,1,1],{minCutOff:i,maxCutOff:a}=this.cutOffs??{minCutOff:[0,0,0],maxCutOff:[255,255,255]};1===i.length&&(i[1]=i[2]=i[0],a[1]=a[2]=a[0]);const u=new Float32Array(r);let l;for(l=0;l<r;l++)u[l]=(e-t)/(a[l]-i[l]);const c=this._isOutputRoundingNeeded();return{bandCount:r,outMin:t,outMax:e,minCutOff:i,maxCutOff:a,factor:u,useGamma:s,gamma:s&&n?n:[1,1,1],gammaCorrection:s&&o?o:[1,1,1],stretchType:this.functionArguments.stretchType,isOutputRounded:c,type:"stretch"}}};(0,i._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],bn.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({type:gn,json:{write:!0,name:"rasterFunctionArguments"}})],bn.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],bn.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],bn.prototype,"lookup",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],bn.prototype,"cutOffs",void 0),bn=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.StretchFunction")],bn);const xn=bn;var wn;let vn=wn=class extends p{constructor(){super(...arguments),this.attributeTableAsRecordSet=null}clone(){return new wn({attributeTableAsRecordSet:(0,o.d9)(this.attributeTableAsRecordSet)})}};(0,i._)([(0,a.Cb)({json:{write:!0}})],vn.prototype,"attributeTableAsRecordSet",void 0),vn=wn=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.TableFunctionArguments")],vn);const _n=vn;let Cn=class extends w{constructor(){super(...arguments),this.functionName="Table",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1||t.pixelType.startsWith("f"))return{success:!1,supportsGPU:!1,error:"table-function: Source data must be single band and integer pixel type."};const{attributeTableAsRecordSet:e}=this.functionArguments;if(!e)return{success:!1,supportsGPU:!1,error:"table-function: Missing attributeTableAsRecordSet argument."};this.outputPixelType=this._getOutputPixelType(t.pixelType);const n=t.clone();return n.pixelType=this.outputPixelType,n.bandCount=1,"thematic"!==n.dataType&&(n.keyProperties=n.keyProperties?{...n.keyProperties,DataType:"thematic"}:{DataType:"thematic"}),this.rasterInfo=n,{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}};(0,i._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],Cn.prototype,"functionName",void 0),(0,i._)([(0,a.Cb)({type:_n,json:{write:!0,name:"rasterFunctionArguments"}})],Cn.prototype,"functionArguments",void 0),(0,i._)([(0,a.Cb)()],Cn.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.Cb)()],Cn.prototype,"isNoopProcess",void 0),Cn=(0,i._)([(0,u.j)("esri.layers.support.rasterFunctions.TableFunction")],Cn);const An=Cn,Pn=new Map;function Rn(t,e){const{rasterFunctionArguments:n}=t;n&&(n.rasters||[n.raster]).forEach((t=>{t&&"number"!=typeof t&&("string"==typeof t?t.startsWith("http")&&(e.includes(t)||e.push(t)):"rasterFunctionArguments"in t&&Rn(t,e))}))}function Nn(t,e){if(e=e??{},"function"in(t=(0,o.d9)(t))&&"arguments"in t&&t.arguments){const n=Mn(t,new Map,e);if(Gn(n),!n.renderingRule)throw new r.Z("raster-function-helper","Unsupported raster function json.");t=n.renderingRule}if("rasterFunction"in t)return Fn(t=In(t),e);throw new r.Z("raster-function-helper","unsupported raster function json.")}function Tn(t){return!!(t&&"object"==typeof t&&t.rasterFunction&&t.rasterFunctionArguments)}function In(t){const{rasterFunction:e,rasterFunctionArguments:n}=t,s={};for(const t in n){let e=n[t];const r=t.toLowerCase();if("rasters"===r&&Array.isArray(e))s.rasters=e.map((t=>Tn(t)?In(t):t));else switch(Tn(e)&&(e=In(e)),r){case"dra":s.dra=e;break;case"pspower":s.psPower=e;break;case"pszfactor":s.psZFactor=e;break;case"bandids":s.bandIds=e;break;default:s[t[0].toLowerCase()+t.slice(1)]=e}}return"Local"!==e||s.rasters?.length||(s.rasters=["$$"]),{...t,rasterFunctionArguments:s}}function Fn(t,e){const{rasterFunction:n,rasterFunctionArguments:s}=t,o=t.outputPixelType?.toLowerCase();if(null==n||!Pn.has(n))throw new r.Z("raster-function-helper",`unsupported raster function: ${n}`);const i=Pn.get(n),a=("function"==typeof i.ctor?i.ctor:i.ctor.default).fromJSON({...t,outputPixelType:o}),{rasterArgumentNames:u}=a,l=[],c=function(t,e){return"rasters"===e[0]&&Array.isArray(t.rasters)?t.rasters:e.map((e=>t[e]))}(s,u),p="rasters"===u[0],f=[];for(let t=0;t<c.length;t++){const n=c[t];let s;null==n||"string"==typeof n&&n.startsWith("$")?l.push(e?.raster):"string"==typeof n?e[n]&&l.push(e[n]):"number"!=typeof n&&"rasterFunction"in n&&(s=Fn(n,e),p||(a.functionArguments[u[t]]=s),l.push(s)),p&&f.push(s??n)}if(p&&(a.functionArguments.rasters=f),e){a.sourceRasters=l;const t=e.raster?.url;t&&(a.mainPrimaryRasterId=t)}return a}function jn(t,e){if(t&&e)for(const n in t){const s=t[n];s&&"object"==typeof s&&"type"in s&&("RasterFunctionTemplate"===s.type?jn(s.arguments,e):"RasterFunctionVariable"===s.type&&null!=e[s.name]&&(s.value=e[s.name]))}}function kn(t,e){if(!t||"object"!=typeof t)return t;const{value:n}=t;if(!n||"object"!=typeof n)return t.isDataset?"$$":n;if(Array.isArray(n))return 0===n.length?[]:n.map((t=>"object"==typeof t&&"RasterFunctionVariable"===t.type?kn(t,e):t));if("value"in n&&["number","string","boolean"].includes(typeof n.value))return n.value;if(t.isDataset&&"Scalar"!==n.type)return"$$";if(!("type"in n))return n;let s=n;switch(n.type){case"Scalar":s=n.value;break;case"AlgorithmicColorRamp":s=Sn(n);break;case"MultiPartColorRamp":s={type:"multipart",colorRamps:n.ArrayOfColorRamp.map(Sn)};break;case"ArgumentArray":if(n.elements?.length&&"RasterStatistics"!==n.elements[0].type){const t=[];for(let s=0;s<n.elements.length;s++){const o=n.elements[s],{type:i}=o;if(i)if("RasterFunctionTemplate"===i){const{renderingRule:n}=Mn(o,e);t.push(n),null!=o._object_id&&e.set(o._object_id,n)}else{if("RasterFunctionVariable"!==i)throw new r.Z("raster-function-helper","unsupported raster function json.");{const n=kn(o,e);t.push(n),null!=o._object_id&&e.set(o._object_id,n)}}else t.push(o)}s=t}else s=n.elements}return null!=n._object_id&&e.set(n._object_id,s),s}function Sn(t){const e=t.algorithm??"esriHSVAlgorithm";let{FromColor:n,ToColor:r}=t;if(!Array.isArray(n)){const{r:t,g:e,b:r}=(0,s.xr)({h:n.Hue,s:n.Saturation,v:n.Value});n=[t,e,r,n.AlphaValue]}if(!Array.isArray(r)){const{r:t,g:e,b:n}=(0,s.xr)({h:r.Hue,s:r.Saturation,v:r.Value});r=[t,e,n,r.AlphaValue]}return{type:"algorithmic",algorithm:e,fromColor:n,toColor:r}}function Mn(t,e,n){n&&jn(t,n);const s={renderingRule:{},templates:e};return Bn(t,s),s}function Bn(t,e){if(!t||!e.renderingRule)return;const{renderingRule:n,templates:s}=e,{function:r,arguments:o,_object_id:i}=t;if(!r||!o)return;null!=i&&s.set(i,n),n.rasterFunction=r.type.replace("Function",""),n.outputPixelType=r.pixelType;const a={};n.rasterFunctionArguments=a;for(const t in o){if("type"===t||"object_id"===t||"_object_ref_id"===t)continue;const e=o[t];e&&"object"==typeof e&&"type"in e&&("RasterFunctionTemplate"===e.type||"RasterFunctionVariable"===e.type)?("RasterFunctionVariable"===e.type?a[t]=kn(e,s):(n.rasterFunctionArguments[t]={},Bn(e,{renderingRule:n.rasterFunctionArguments[t],templates:s})),null!=e._object_id&&s.set(e._object_id,a[t])):a[t]=e}switch(a.DEM&&!a.Raster&&(a.Raster=a.DEM,delete a.DEM),n.rasterFunction){case"Stretch":!function(t){t.Statistics?.length&&"object"==typeof t.Statistics&&(t.Statistics=t.Statistics.map((t=>[t.min,t.max,t.mean,t.standardDeviation]))),null!=t.NumberOfStandardDeviation&&(t.NumberOfStandardDeviations=t.NumberOfStandardDeviation,delete t.NumberOfStandardDeviation)}(a);break;case"Colormap":!function(t){"randomcolorramp"===t.ColorRamp?.type?.toLowerCase()&&(delete t.ColorRamp,t.ColormapName="Random"),0===t.ColorSchemeType&&delete t.ColorRamp}(a);break;case"Convolution":!function(t){null!=t.ConvolutionType&&(t.Type=t.ConvolutionType,delete t.ConvolutionType)}(a);break;case"Mask":!function(t){t.NoDataValues?.length&&"string"==typeof t.NoDataValues[0]&&(t.NoDataValues=t.NoDataValues.filter((t=>""!==t)).map((t=>Number(t))))}(a)}}function Gn(t){const{renderingRule:e,templates:n}=t;if("object"!=typeof e||!e?.rasterFunctionArguments||!n.size)return;const{rasterFunctionArguments:s}=e;for(const t in s){const e=s[t],o="_object_ref_id"===t?e:e&&"object"==typeof e&&"_object_ref_id"in e?e._object_ref_id:null;if(null==o)e&&"object"==typeof e&&(e.rasterFunctionArguments&&Gn({renderingRule:e,templates:n}),Array.isArray(e)&&e.forEach(((t,s)=>{if("object"==typeof t)if(null!=t._object_ref_id){if(!n.has(t._object_ref_id))throw new r.Z("raster-function-helper",`unsupported raster function json. _object_ref_id: ${e} does not exist`);const i=n.get(o);i&&"object"==typeof i?Object.assign(t,i):e[s]=i}else Gn({renderingRule:t,templates:n})})));else{if(!n.has(o))throw new r.Z("raster-function-helper",`unsupported raster function json. _object_ref_id: ${o} does not exist`);const e=n.get(o);"_object_ref_id"!==t?s[t]=e:e&&"object"==typeof e&&Object.assign(s,e)}}}Pn.set("Aspect",{desc:"Aspect Function",ctor:C,rasterArgumentNames:["raster"]}),Pn.set("BandArithmetic",{desc:"Band Arithmetic Function",ctor:z,rasterArgumentNames:["raster"]}),Pn.set("Colormap",{desc:"Colormap Function",ctor:Y,rasterArgumentNames:["raster"]}),Pn.set("CompositeBand",{desc:"CompositeBand Function",ctor:st,rasterArgumentNames:["rasters"]}),Pn.set("Convolution",{desc:"Convolution Function",ctor:bt,rasterArgumentNames:["raster"]}),Pn.set("ExtractBand",{desc:"ExtractBand Function",ctor:It,rasterArgumentNames:["raster"]}),Pn.set("Curvature",{desc:"Curvature Function",ctor:At,rasterArgumentNames:["raster"]}),Pn.set("Local",{desc:"Local Function",ctor:De,rasterArgumentNames:["rasters"]}),Pn.set("Mask",{desc:"Mask Function",ctor:We,rasterArgumentNames:["raster"]}),Pn.set("NDVI",{desc:"NDVI Function",ctor:He,rasterArgumentNames:["raster"]}),Pn.set("Remap",{desc:"Remap Function",ctor:tn,rasterArgumentNames:["raster"]}),Pn.set("Slope",{desc:"Slope Function",ctor:an,rasterArgumentNames:["raster"]}),Pn.set("StatisticsHistogram",{desc:"Statistics Histogram Function",ctor:fn,rasterArgumentNames:["raster"]}),Pn.set("Stretch",{desc:"Stretch Function",ctor:xn,rasterArgumentNames:["raster"]}),Pn.set("Table",{desc:"Attribute Table Function",ctor:An,rasterArgumentNames:["raster"]})},73506:(t,e,n)=>{n.d(e,{Hq:()=>Z,Mk:()=>m,P_:()=>V,Qp:()=>L,VO:()=>P,Wt:()=>G,kZ:()=>q,kr:()=>X,nF:()=>N,tB:()=>B,ut:()=>D,zD:()=>A}),n(66577);var s,r,o=n(67676),i=n(20102),a=n(67900),u=n(83305),l=n(44547),c=n(6570),p=n(94139),f=n(38913),h=n(82971);function m(t,e,n){return!(0,l.Up)(t,e,n)}function d(t,e,n){const s=m(t,e,n);if(s&&!(0,l.kR)())throw new i.Z("rasterprojectionhelper-project","projection engine is not loaded");return s}(r=s||(s={}))[r.None=0]="None",r[r.North=1]="North",r[r.South=2]="South",r[r.Both=3]="Both";const g=(t,e,n,s=0)=>{if(1===n[0])return[0,0];let r=1,o=-1,i=1,a=-1;for(let e=0;e<t.length;e+=2)isNaN(t[e])||(r=r>t[e]?t[e]:r,o=o>t[e]?o:t[e],i=i>t[e+1]?t[e+1]:i,a=a>t[e+1]?a:t[e+1]);const{cols:u,rows:l}=e,c=(o-r)/u/n[0],p=(a-i)/l/n[1],f=2*s;let h=0,m=!1,d=[0,0];for(let e=0;e<u-3;e++){for(let n=0;n<l-3;n++){const s=e*l*2+2*n,r=(t[s]+t[s+4]+t[s+4*l]+t[s+4*l+4])/4,o=(t[s+1]+t[s+5]+t[s+4*l+1]+t[s+4*l+5])/4,i=Math.abs((r-t[s+2*l+2])/c),a=Math.abs((o-t[s+2*l+3])/p);if(i+a>h&&(h=i+a,d=[i,a]),f&&h>f){m=!0;break}}if(m)break}return d},y={3395:20037508.342789244,3410:17334193.943686873,3857:20037508.342788905,3975:17367530.445161372,4087:20037508.342789244,4088:20015108.787169147,6933:17367530.445161372,32662:20037508.342789244,53001:20015086.79602057,53002:10007543.39801029,53003:20015086.79602057,53004:20015086.79602057,53016:14152803.599503474,53017:17333573.624304302,53034:20015086.79602057,53079:20015114.352186374,53080:20015114.352186374,54001:20037508.342789244,54002:10018754.171394624,54003:20037508.342789244,54004:20037508.342789244,54016:14168658.027268292,54017:17367530.44516137,54034:20037508.342789244,54079:20037508.342789244,54080:20037508.342789244,54100:20037508.342789244,54101:20037508.342789244},b=32,x=4,w=x,v=new Map,_=new Map,C=500;async function A(){(0,l.kR)()||await(0,l.zD)()}function P(t,e,n,s=null){const r=t.spatialReference;if(r.equals(e))return t;d(r,e,s);const o=n.center,i=new c.Z({xmin:o.x-t.x/2,xmax:o.x+t.x/2,ymin:o.y-t.y/2,ymax:o.y+t.y/2,spatialReference:r}),u=(0,l.iV)(i,e,s),p=D(e);let f;if(null==u||null!=p&&u.width>=p){const n=(0,a.c9)(r)/(0,a.c9)(e);f={x:t.x*n,y:t.y*n}}else f={x:u.width,y:u.height};return f}function R(t,e=.01){return(0,a.c9)(t)?e/(0,a.c9)(t):0}function N(t,e,n=null,s=!0){const r=t.spatialReference;if(r.equals(e))return t;d(r,e,n);const o=(0,l.iV)(t,e,n);return s&&o?(T([t],[o],r,e),o):o}function T(t,e,n,s){const r=O(n,!0),o=O(s,!0),i=R(n,C),a=R(s,C);if(i&&null!=r&&null!=o)for(let n=0;n<t.length;n++){const s=e[n];if(!s)continue;const{x:u}=t[n],{x:l}=s;l>=o[1]-a&&Math.abs(u-r[0])<i?s.x-=o[1]-o[0]:l<=o[0]+a&&Math.abs(u-r[1])<i&&(s.x+=o[1]-o[0])}}function I(t){const{inSR:e,outSR:n,datumTransformation:s,preferPE:r}=t;if(e.equals(n)){const{points:e}=S(t,null);return e}if(e.isWebMercator&&n.isWGS84||e.isWGS84&&n.isWebMercator)return function(t){const{cols:e,rows:n,xres:s,yres:r,usePixelCenter:o,inSR:i,outSR:a}=t;let{xmin:u,ymax:c}=t;o&&(u+=s/2,c-=r/2);const f=[],h=[],m=Math.max(e,n);for(let t=0;t<m;t++){const o=u+s*Math.min(e,t),m=c-r*Math.min(n,t),d=(0,l.iV)(new p.Z({x:o,y:m,spatialReference:i}),a);t<=e&&f.push(d.x),t<=n&&h.push(d.y)}const d=[];for(let t=0;t<e;t++)for(let e=0;e<n;e++)d.push([f[t],h[e]]);return d}(t);if(d(e,n,s)&&r){if(e.isGeographic)return F(t);if(null!=j(e))return F(t)}return function(t){const{points:e}=S(t,null),{inSR:n,outSR:s,datumTransformation:r}=t,o=e.map((t=>new p.Z(t[0],t[1],n))),i=(0,l.iV)(o,s,r);return r&&T(o,i,n,s),i.map((t=>t?[t.x,t.y]:[NaN,NaN]))}(t)}function F(t){const{inSR:e,outSR:n,datumTransformation:s}=t,r=j(e),{points:o,mask:i}=S(t,r);if(!e.isGeographic){const t=e.wkid?u.e.coordsys(e.wkid):u.e.fromString(e.isGeographic?u.f.PE_TYPE_GEOGCS:u.f.PE_TYPE_PROJCS,e.wkt);u.g.projToGeog(t,o.length,o)}if(null!=s&&s.steps.length){let t;const e=179.9955;if(n.isGeographic&&(t=o.map((([t])=>t>e?1:t<-e?-1:0))),s.steps.forEach((t=>{const e=t.wkid?u.e.geogtran(t.wkid):u.e.fromString(u.f.PE_TYPE_GEOGTRAN,t.wkt);u.h.geogToGeog(e,o.length,o,null,t.isInverse?u.f.PE_TRANSFORM_2_TO_1:u.f.PE_TRANSFORM_1_TO_2)})),t)for(let n=0;n<o.length;n++){const s=t[n],r=o[n][0],i=r>e?1:r<-e?-1:0;s&&i&&s!==i&&(o[n][0]=s>0?r+360:r-360)}}if(!n.isGeographic){const t=j(n,!0),e=null!=t&&t.isEnvelope?[t.bbox[1],t.bbox[3]]:[-90,90];!function(t,e){const[n,s]=e;for(let e=0;e<t.length;e++){const r=t[e][1];(r<n||r>s)&&(t[e]=[NaN,NaN])}}(o,e);const s=n.wkid?u.e.coordsys(n.wkid):u.e.fromString(n.isGeographic?u.f.PE_TYPE_GEOGCS:u.f.PE_TYPE_PROJCS,n.wkt);u.g.geogToProj(s,o.length,o)}let a=o;if(i&&o.length!==i.length){a=[];for(let t=0,e=0;t<i.length;t++)i[t]?a.push(o[e++]):a.push([NaN,NaN])}return a}function j(t,e=!1){let n=t.wkid||t.wkt;if(!n||t.isGeographic)return null;if(n=String(n),v.has(n)){const t=v.get(n);return e?t?.gcs:t?.pcs}const s=t.wkid?u.e.coordsys(t.wkid):u.e.fromString(t.isGeographic?u.f.PE_TYPE_GEOGCS:u.f.PE_TYPE_PROJCS,t.wkt),r=k(s,R(t,1e-4)),o=k(s,0,!0);return v.set(n,{pcs:r,gcs:o}),e?o:r}function k(t,e=0,n=!1){const s=u.j.generate(t),r=n?t.horizonGcsGenerate():t.horizonPcsGenerate();if(!s||!r?.length)return null;let o=!1,i=r.find((t=>1===t.getInclusive()&&1===t.getKind()));if(!i){if(i=r.find((t=>1===t.getInclusive()&&0===t.getKind())),!i)return null;o=!0}const a=n?0:(2===s.getNorthPoleLocation()?1:0)|(2===s.getSouthPoleLocation()?2:0),l=s.isPannableRectangle(),c=i.getCoord();if(o)return{isEnvelope:o,isPannable:l,vertices:c,coef:null,bbox:[c[0][0]-e,c[0][1]-e,c[1][0]+e,c[1][1]+e],poleLocation:a};let p=0;const f=[];let[h,m]=c[0],[d,g]=c[0];for(let t=0,e=c.length;t<e;t++){p++,p===e&&(p=0);const[n,s]=c[t],[r,o]=c[p];if(o===s)f.push([n,r,s,o,2]);else{const t=(r-n)/(o-s||1e-4),e=n-t*s;s<o?f.push([t,e,s,o,0]):f.push([t,e,o,s,1])}h=h<n?h:n,m=m<s?m:s,d=d>n?d:n,g=g>s?g:s}return{isEnvelope:!1,isPannable:l,vertices:c,coef:f,bbox:[h,m,d,g],poleLocation:a}}function S(t,e){const n=[],{cols:s,rows:r,xres:o,yres:i,usePixelCenter:a}=t;let{xmin:u,ymax:l}=t;if(a&&(u+=o/2,l-=i/2),null==e){for(let t=0;t<s;t++)for(let e=0;e<r;e++)n.push([u+o*t,l-i*e]);return{points:n}}const c=new Uint8Array(s*r);if(e.isEnvelope){const{bbox:[t,a,p,f]}=e;for(let h=0,m=0;h<s;h++){const s=u+o*h,d=e.isPannable||s>=t&&s<=p;for(let t=0;t<r;t++,m++){const e=l-i*t;d&&e>=a&&e<=f&&(n.push([s,e]),c[m]=1)}}return{points:n,mask:c}}const p=e.coef,f=[];for(let t=0;t<r;t++){const e=l-i*t,n=[],s=[];for(let t=0;t<p.length;t++){const[r,o,i,a,u]=p[t];if(e===i&&i===a)n.push(r),n.push(o),s.push(2),s.push(2);else if(e>=i&&e<=a){const t=r*e+o;n.push(t),s.push(u)}}let r=n;if(n.length>2){let t=2===s[0]?0:s[0],e=n[0];r=[];for(let o=1;o<s.length;o++)2===s[o]&&o!==s.length-1||(s[o]!==t&&(r.push(0===t?Math.min(e,n[o-1]):Math.max(e,n[o-1])),t=s[o],e=n[o]),o===s.length-1&&r.push(0===s[o]?Math.min(e,n[o]):Math.max(e,n[o])));r.sort(((t,e)=>t-e))}else n[0]>n[1]&&(r=[n[1],n[0]]);f.push(r)}for(let t=0,e=0;t<s;t++){const s=u+o*t;for(let t=0;t<r;t++,e++){const r=l-i*t,o=f[t];if(2===o.length)s>=o[0]&&s<=o[1]&&(n.push([s,r]),c[e]=1);else if(o.length>2){let t=!1;for(let e=0;e<o.length;e+=2)if(s>=o[e]&&s<=o[e+1]){t=!0;break}t&&(n.push([s,r]),c[e]=1)}}}return{points:n,mask:c}}function M(t,e){const n=D(t[0].spatialReference);if(t.length<2||null==n)return t[0];if(e=e??R(t[0].spatialReference),1===(t=t.filter((t=>t.width>e))).length)return t[0];let{xmin:s,xmax:r,ymin:o,ymax:i}=t[0];for(let e=1;e<t.length;e++){const s=t[e];r=s.xmax+n*e,o=Math.min(o,s.ymin),i=Math.max(i,s.ymax)}return new c.Z({xmin:s,xmax:r,ymin:o,ymax:i,spatialReference:t[0].spatialReference})}function B(t,e,n=null,r=!0){const i=t.spatialReference;if(i.equals(e))return t;const a=Z(t),u=D(i,!0),p=D(e);if(0===a||null==u||null==p){const o=E(t,e,n,r);if(null==u&&null!=p&&Math.abs(o.width-p)<R(e)&&(0,l.kR)()){const n=j(i);if(null!=n&&n.poleLocation===s.None&&t.width<(n.bbox[2]-n.bbox[0])/2)return function(t,e){const n=D(e);if(null==n)return null;let{xmin:s,ymin:r,xmax:o,ymax:i}=t;const a=t.spatialReference,u=new f.Z({spatialReference:a,rings:[[[s,r],[o,r],[o,i],[s,i],[s,r]]]}),p=(0,l.iV)(u,e);if(2!==p.rings.length||!p.rings[0].length||!p.rings[1].length)return null;const{rings:h}=p,m=R(a),d=new c.Z({spatialReference:e});for(let t=0;t<2;t++){s=o=h[t][0][0],r=i=h[t][0][1];for(let e=0;e<h[t].length;e++)s=s>h[t][e][0]?h[t][e][0]:s,o=o<h[t][e][0]?h[t][e][0]:o,r=r>h[t][e][1]?h[t][e][1]:r,i=i<h[t][e][1]?h[t][e][1]:i;if(0===t)d.ymin=r,d.ymax=i,d.xmin=s,d.xmax=o;else if(d.ymin=Math.min(d.ymin,r),d.ymax=Math.max(d.ymax,i),Math.abs(o-n/2)<m)d.xmin=s,d.xmax=d.xmax+n;else{if(!(Math.abs(s+n/2)<m))return null;d.xmax=o+n}}return d}(t,e)||o}return o}const h=t.clone().normalize();if(1===h.length&&t.xmax<u&&t.xmax-u/2>R(i)){const{xmin:e,xmax:n}=t;for(let s=0;s<=a;s++){const r=0===s?e:-u/2,o=s===a?n-u*s:u/2;h[s]=new c.Z({xmin:r,xmax:o,ymin:t.ymin,ymax:t.ymax,spatialReference:i})}}return M(h.map((t=>E(t,e,n,r))).filter(o.pC))}function G(t,e,n){if("extent"===t.type){const{xmin:e,ymin:n,xmax:s,ymax:r,spatialReference:o}=t;t=new f.Z({rings:[[[e,r],[s,r],[s,n],[e,n],[e,r]]],spatialReference:o})}return t.spatialReference.equals(e)?t:(d(t.spatialReference,e,n),(0,l.iV)(t,e,n))}function E(t,e,n=null,s=!0,r=!0){const o=t.spatialReference;if(o.equals(e)||!e)return t;d(o,e,n);const i=(0,l.iV)(t,e,n);if(r&&e.isWebMercator&&i&&(i.ymax=Math.min(20037508.342787,i.ymax),i.ymin=Math.max(-20037508.342787,i.ymin),i.ymin>=i.ymax))return null;if(!s||!i)return i;const a=O(o,!0),u=O(e,!0);if(null==a||null==u)return i;const c=R(o,.001),f=R(o,C),h=R(e,.001);if(Math.abs(i.xmin-u[0])<h&&Math.abs(i.xmax-u[1])<h){const s=Math.abs(t.xmin-a[0]),r=Math.abs(a[1]-t.xmax);if(s<c&&r>f){i.xmin=u[0];const s=[];s.push(new p.Z(t.xmax,t.ymin,o)),s.push(new p.Z(t.xmax,(t.ymin+t.ymax)/2,o)),s.push(new p.Z(t.xmax,t.ymax,o));const r=s.map((t=>N(t,e,n))).filter((t=>!isNaN(t?.x))).map((t=>t.x));i.xmax=Math.max.apply(null,r)}if(r<c&&s>f){i.xmax=u[1];const s=[];s.push(new p.Z(t.xmin,t.ymin,o)),s.push(new p.Z(t.xmin,(t.ymin+t.ymax)/2,o)),s.push(new p.Z(t.xmin,t.ymax,o));const r=s.map((t=>N(t,e,n))).filter((t=>!isNaN(t?.x))).map((t=>t.x));i.xmin=Math.min.apply(null,r)}}else{const t=R(e,.001);Math.abs(i.xmin-u[0])<t&&(i.xmin=u[0]),Math.abs(i.xmax-u[1])<t&&(i.xmax=u[1])}return i}function D(t,e=!1){if(!t)return null;const n=e?20037508.342787:20037508.342788905;return t.isWebMercator?2*n:t.wkid&&t.isGeographic?360:2*y[t.wkid]||null}function O(t,e=!1){if(t.isGeographic)return[-180,180];const n=D(t,e);return null!=n?[-n/2,n/2]:null}function z(t,e,n,s){let r=(t-e)/n;return r-Math.floor(r)!=0?r=Math.floor(r):s&&(r-=1),r}function Z(t,e=!1){const n=D(t.spatialReference);if(null==n)return 0;const s=e?0:-n/2,r=R(t.spatialReference),o=!e&&Math.abs(t.xmax-n/2)<r?n/2:t.xmax,i=!e&&Math.abs(t.xmin+n/2)<r?-n/2:t.xmin;return z(o,s,n,!0)-z(i,s,n,!1)}function V(t){const e=t.storageInfo.origin.x,n=D(t.spatialReference,!0);if(null==n)return{originX:e,halfWorldWidth:null,pyramidsInfo:null};const s=n/2,{nativePixelSize:r,storageInfo:o,extent:i}=t,{maximumPyramidLevel:a,blockWidth:u,pyramidScalingFactor:l}=o;let c=r.x;const p=[],f=null!=t.transform&&"gcs-shift"===t.transform.type,h=e+(f?0:s),m=f?n-e:s-e;for(let t=0;t<=a;t++){const t=(i.xmax-e)/c/u,n=t-Math.floor(t)==0?t:Math.ceil(t),s=m/c/u,r=s-Math.floor(s)==0?s:Math.ceil(s),o=Math.floor(h/c/u),a=Math.round(h/c)%u,f=(u-Math.round(m/c)%u)%u;p.push({resolutionX:c,blockWidth:u,datsetColumnCount:n,worldColumnCountFromOrigin:r,leftMargin:a,rightPadding:f,originColumnOffset:o}),c*=l}return{originX:e,halfWorldWidth:s,pyramidsInfo:p,hasGCSSShiftTransform:f}}function L(t){const e=t.isAdaptive&&null==t.spacing;let n=t.spacing||[b,b],s=W(t),r={cols:s.size[0]+1,rows:s.size[1]+1};const o=s.outofBoundPointCount>0&&s.outofBoundPointCount<s.offsets.length/2;let i=s.outofBoundPointCount===s.offsets.length/2||e&&o?[0,0]:g(s.offsets,r,n,w);const a=(i[0]+i[1])/2,l=t.projectedExtent.spatialReference,c=t.srcBufferExtent.spatialReference;if(e&&(o||a>w)&&(m(l,c,t.datumTransformation)&&(l.isGeographic||j(l)),n=[x,x],s=W({...t,spacing:n}),r={cols:s.size[0]+1,rows:s.size[1]+1},i=g(s.offsets,r,n,w)),s.error=i,n[0]>1&&(s.coefficients=U(s.offsets,r,o)),t.includeGCSGrid&&!l.isGeographic&&!l.isWebMercator)if(c.isGeographic)s.gcsGrid={offsets:s.offsets,coefficients:s.coefficients,spacing:n};else{const e=j(l);if(null!=e&&!e.isEnvelope){const e=function(t){if(!t||t.isGeographic)return t;const e=String(t.wkid||t.wkt);let n;return _.has(e)?n=_.get(e):(n=(t.wkid?u.e.coordsys(t.wkid):u.e.fromString(u.f.PE_TYPE_PROJCS,t.wkt)).getGeogcs().getCode(),_.set(e,n)),new h.Z({wkid:n})}(l),i=B(t.projectedExtent,e),{offsets:a}=W({...t,srcBufferExtent:i,spacing:n}),c=U(a,r,o);s.gcsGrid={offsets:a,coefficients:c,spacing:n}}}return s}function W(t){const{projectedExtent:e,srcBufferExtent:n,pixelSize:s,datumTransformation:r,rasterTransform:o}=t,i=e.spatialReference,a=n.spatialReference,u=d(i,a),{xmin:l,ymin:c,xmax:f,ymax:h}=e,m=D(a),g=null!=m&&(t.hasWrapAround||"gcs-shift"===o?.type),y=t.spacing||[b,b],w=y[0]*s.x,v=y[1]*s.y,_=1===y[0],A=Math.ceil((f-l)/w-.1/y[0])+(_?0:1),P=Math.ceil((h-c)/v-.1/y[1])+(_?0:1),N=I({cols:A,rows:P,xmin:l,ymax:h,xres:w,yres:v,inSR:i,outSR:a,datumTransformation:r,preferPE:y[0]<=x,usePixelCenter:_}),T=[];let F,k=0;const S=_?-1:NaN,{xmin:M,xmax:B,ymax:G,width:E,height:O}=n,z=R(a,C),Z=null!=m&&M>0&&B>m/2;let V=!1;if(u){const t=j(i);V=null!=t&&t.poleLocation>0}for(let t=0;t<A;t++){const e=[];for(let n=0;n<P;n++){let s=N[t*P+n];if(g&&s[0]>B&&s[0]>m/2-z?s[0]-=m:g&&0===t&&s[0]<0&&Z&&!o&&(s[0]+=m),!s||isNaN(s[0])||isNaN(s[1]))T.push(S),T.push(S),e.push(null),k++;else{if(o){const t=o.inverseTransform(new p.Z({x:s[0],y:s[1],spatialReference:a}));s=[t.x,t.y]}e.push(s),t>0&&g&&F[n]&&s[0]<F[n][0]&&(s[0]+=m,V&&s[0]>B&&s[0]>m&&(s[0]-=m)),T.push((s[0]-M)/E),T.push((G-s[1])/O)}}F=e}return{offsets:T,error:null,coefficients:null,outofBoundPointCount:k,spacing:y,size:_?[A,P]:[A-1,P-1]}}function U(t,e,n){const{cols:s,rows:r}=e,o=new Float32Array((s-1)*(r-1)*2*6),i=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),a=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let e=0;e<s-1;e++){for(let n=0;n<r-1;n++){let u=e*r*2+2*n;const l=t[u],c=t[u+1],p=t[u+2],f=t[u+3];u+=2*r;const h=t[u],m=t[u+1],d=t[u+2],g=t[u+3];let y=0,b=12*(n*(s-1)+e);for(let t=0;t<3;t++)o[b++]=i[y++]*l+i[y++]*p+i[y++]*d;y=0;for(let t=0;t<3;t++)o[b++]=i[y++]*c+i[y++]*f+i[y++]*g;y=0;for(let t=0;t<3;t++)o[b++]=a[y++]*l+a[y++]*h+a[y++]*d;y=0;for(let t=0;t<3;t++)o[b++]=a[y++]*c+a[y++]*m+a[y++]*g}if(n)for(let t=0;t<o.length;t++)isNaN(o[t])&&(o[t]=-1)}return o}function q(t,e){const n=t.clone().normalize();return 1===n.length?n[0]:M(n,e)}function X(t,e,n){const{storageInfo:s,pixelSize:r}=e;let o=0,i=!1;const{pyramidResolutions:u}=s,l="mixed"===s.tileInfo.format?.toLowerCase()?Math.max(1,Math.min(3,s.tileInfo.dpi/96)):1,c=(t.x+t.y)/2/l;if(null!=u&&u.length){const t=u.at(-1),s=(t.x+t.y)/2,l=(r.x+r.y)/2;if(c<=l)o=0;else if(c>=s)o=u.length,i=c/s>8;else{let t,e=l;for(let s=1;s<=u.length;s++){if(t=(u[s-1].x+u[s-1].y)/2,c<=t){c===t?o=s:"down"===n?(o=s-1,i=c/e>8):o="up"===n||c-e>t-c||c/e>2?s:s-1;break}e=t}}const f=0===o?r:u[o-1];return i&&Math.min(f.x,f.y)*(0,a.c9)(e.spatialReference)>19567&&(i=!1),{pyramidLevel:o,pyramidResolution:new p.Z({x:f.x,y:f.y,spatialReference:e.spatialReference}),excessiveReading:i}}const f=Math.log(t.x/r.x)/Math.LN2,h=Math.log(t.y/r.y)/Math.LN2,m=e.storageInfo.maximumPyramidLevel||0;o="down"===n?Math.floor(Math.min(f,h)):"up"===n?Math.ceil(Math.max(f,h)):Math.round((f+h)/2),o<0?o=0:o>m&&(i=o>m+3,o=m);const d=2**o;return{pyramidLevel:o,pyramidResolution:new p.Z({x:d*e.nativePixelSize.x,y:d*e.nativePixelSize.y,spatialReference:e.spatialReference}),excessiveReading:i}}},48700:(t,e,n)=>{n.d(e,{Z:()=>u});var s=n(43697),r=n(96674),o=n(5600),i=(n(75215),n(67676),n(80442),n(52011));let a=class extends r.wq{get affectsPixelSize(){return!1}forwardTransform(t){return t}inverseTransform(t){return t}};(0,s._)([(0,o.Cb)()],a.prototype,"affectsPixelSize",null),(0,s._)([(0,o.Cb)({json:{write:!0}})],a.prototype,"spatialReference",void 0),a=(0,s._)([(0,i.j)("esri.layers.support.rasterTransforms.BaseRasterTransform")],a);const u=a},29680:(t,e,n)=>{n.d(e,{Z:()=>c});var s,r=n(43697),o=n(5600),i=(n(75215),n(67676),n(80442),n(36030)),a=n(52011),u=n(48700);let l=s=class extends u.Z{constructor(){super(...arguments),this.type="gcs-shift",this.tolerance=1e-8}forwardTransform(t){return"point"===(t=t.clone()).type?(t.x>180+this.tolerance&&(t.x-=360),t):(t.xmin>=180-this.tolerance?(t.xmax-=360,t.xmin-=360):t.xmax>180+this.tolerance&&(t.xmin=-180,t.xmax=180),t)}inverseTransform(t){return"point"===(t=t.clone()).type?(t.x<-this.tolerance&&(t.x+=360),t):(t.xmin<-this.tolerance&&(t.xmin+=360,t.xmax+=360),t)}clone(){return new s({tolerance:this.tolerance})}};(0,r._)([(0,i.J)({GCSShiftXform:"gcs-shift"})],l.prototype,"type",void 0),(0,r._)([(0,o.Cb)()],l.prototype,"tolerance",void 0),l=s=(0,r._)([(0,a.j)("esri.layers.support.rasterTransforms.GCSShiftTransform")],l);const c=l},87390:(t,e,n)=>{n.d(e,{Z:()=>g});var s,r=n(43697),o=(n(66577),n(5600)),i=(n(75215),n(67676),n(80442),n(36030)),a=n(71715),u=n(52011),l=n(30556),c=n(48700),p=n(94139),f=n(6570);function h(t,e,n){const{x:s,y:r}=e;if(n<2)return{x:t[0]+s*t[2]+r*t[4],y:t[1]+s*t[3]+r*t[5]};if(2===n){const e=s*s,n=r*r,o=s*r;return{x:t[0]+s*t[2]+r*t[4]+e*t[6]+o*t[8]+n*t[10],y:t[1]+s*t[3]+r*t[5]+e*t[7]+o*t[9]+n*t[11]}}const o=s*s,i=r*r,a=s*r,u=o*s,l=o*r,c=s*i,p=r*i;return{x:t[0]+s*t[2]+r*t[4]+o*t[6]+a*t[8]+i*t[10]+u*t[12]+l*t[14]+c*t[16]+p*t[18],y:t[1]+s*t[3]+r*t[5]+o*t[7]+a*t[9]+i*t[11]+u*t[13]+l*t[15]+c*t[17]+p*t[19]}}function m(t,e,n){const{xmin:s,ymin:r,xmax:o,ymax:i,spatialReference:a}=e;let u=[];if(n<2)u.push({x:s,y:i}),u.push({x:o,y:i}),u.push({x:s,y:r}),u.push({x:o,y:r});else{let t=10;for(let e=0;e<t;e++)u.push({x:s,y:r+(i-r)*e/(t-1)}),u.push({x:o,y:r+(i-r)*e/(t-1)});t=8;for(let e=1;e<=t;e++)u.push({x:s+(o-s)*e/t,y:r}),u.push({x:s+(o-s)*e/t,y:i})}u=u.map((e=>h(t,e,n)));const l=u.map((t=>t.x)),c=u.map((t=>t.y));return new f.Z({xmin:Math.min.apply(null,l),xmax:Math.max.apply(null,l),ymin:Math.min.apply(null,c),ymax:Math.max.apply(null,c),spatialReference:a})}let d=s=class extends c.Z{constructor(){super(...arguments),this.polynomialOrder=1,this.type="polynomial"}readForwardCoefficients(t,e){const{coeffX:n,coeffY:s}=e;if(!n?.length||!s?.length||n.length!==s.length)return null;const r=[];for(let t=0;t<n.length;t++)r.push(n[t]),r.push(s[t]);return r}writeForwardCoefficients(t,e,n){const s=[],r=[];for(let e=0;e<t?.length;e++)e%2==0?s.push(t[e]):r.push(t[e]);e.coeffX=s,e.coeffY=r}get inverseCoefficients(){let t=this._get("inverseCoefficients");const e=this._get("forwardCoefficients");return!t&&e&&this.polynomialOrder<2&&(t=function(t){const[e,n,s,r,o,i]=t,a=s*i-o*r,u=o*r-s*i;return[(o*n-e*i)/a,(s*n-e*r)/u,i/a,r/u,-o/a,-s/u]}(e)),t}set inverseCoefficients(t){this._set("inverseCoefficients",t)}readInverseCoefficients(t,e){const{inverseCoeffX:n,inverseCoeffY:s}=e;if(!n?.length||!s?.length||n.length!==s.length)return null;const r=[];for(let t=0;t<n.length;t++)r.push(n[t]),r.push(s[t]);return r}writeInverseCoefficients(t,e,n){const s=[],r=[];for(let e=0;e<t?.length;e++)e%2==0?s.push(t[e]):r.push(t[e]);e.inverseCoeffX=s,e.inverseCoeffY=r}get affectsPixelSize(){return this.polynomialOrder>0}forwardTransform(t){if("point"===t.type){const e=h(this.forwardCoefficients,t,this.polynomialOrder);return new p.Z({x:e.x,y:e.y,spatialReference:t.spatialReference})}return m(this.forwardCoefficients,t,this.polynomialOrder)}inverseTransform(t){if("point"===t.type){const e=h(this.inverseCoefficients,t,this.polynomialOrder);return new p.Z({x:e.x,y:e.y,spatialReference:t.spatialReference})}return m(this.inverseCoefficients,t,this.polynomialOrder)}clone(){return new s({polynomialOrder:this.polynomialOrder,forwardCoefficients:this.forwardCoefficients?[...this.forwardCoefficients]:null,inverseCoefficients:this.inverseCoefficients?[...this.inverseCoefficients]:null})}};(0,r._)([(0,o.Cb)({json:{write:!0}})],d.prototype,"polynomialOrder",void 0),(0,r._)([(0,o.Cb)()],d.prototype,"forwardCoefficients",void 0),(0,r._)([(0,a.r)("forwardCoefficients",["coeffX","coeffY"])],d.prototype,"readForwardCoefficients",null),(0,r._)([(0,l.c)("forwardCoefficients")],d.prototype,"writeForwardCoefficients",null),(0,r._)([(0,o.Cb)({json:{write:!0}})],d.prototype,"inverseCoefficients",null),(0,r._)([(0,a.r)("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],d.prototype,"readInverseCoefficients",null),(0,r._)([(0,l.c)("inverseCoefficients")],d.prototype,"writeInverseCoefficients",null),(0,r._)([(0,o.Cb)()],d.prototype,"affectsPixelSize",null),(0,r._)([(0,i.J)({PolynomialXform:"polynomial"})],d.prototype,"type",void 0),d=s=(0,r._)([(0,u.j)("esri.layers.support.rasterTransforms.PolynomialTransform")],d);const g=d},87521:(t,e,n)=>{n.d(e,{j:()=>m,c:()=>d});var s,r=n(29680),o=n(43697),i=(n(92604),n(75215),n(67676),n(80442),n(20102),n(36030)),a=n(52011),u=n(48700);let l=s=class extends u.Z{constructor(){super(...arguments),this.type="identity"}clone(){return new s}};(0,o._)([(0,i.J)({IdentityXform:"identity"})],l.prototype,"type",void 0),l=s=(0,o._)([(0,a.j)("esri.layers.support.rasterTransforms.IdentityTransform")],l);const c=l;var p=n(87390);const f={GCSShiftXform:r.Z,IdentityXform:c,PolynomialXform:p.Z},h=Object.keys(f);function m(t){const e=t?.type;return!t||h.includes(e)}function d(t){const e=t?.type;if(!e)return null;const n=f[t?.type];if(n){const e=new n;return e.read(t),e}return null}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2220],{22862:(e,t,n)=>{n.d(t,{Hg:()=>y,V7:()=>c,uD:()=>h});var r=n(92036),i=n(46791),o=n(1153);const s=["esri.Color","esri.portal.Portal","esri.symbols.support.Symbol3DAnchorPosition2D","esri.symbols.support.Symbol3DAnchorPosition3D"];function a(e){return e instanceof r.Z}function l(e){return e instanceof i.Z?Object.keys(e.items):a(e)?(0,o.vw)(e).keys():e?Object.keys(e):[]}function p(e,t){return e instanceof i.Z?e.items[t]:e[t]}function d(e){return e?e.declaredClass:null}function u(e,t){const n=e.diff;if(n&&"function"==typeof n)return n(e,t);const r=l(e),i=l(t);if(0===r.length&&0===i.length)return;if(!r.length||!i.length||function(e,t){return!(!Array.isArray(e)||!Array.isArray(t))&&e.length!==t.length}(e,t))return{type:"complete",oldValue:e,newValue:t};const o=i.filter((e=>!r.includes(e))),h=r.filter((e=>!i.includes(e))),c=r.filter((n=>i.includes(n)&&p(e,n)!==p(t,n))).concat(o,h).sort(),y=d(e);if(y&&s.includes(y)&&c.length)return{type:"complete",oldValue:e,newValue:t};let f;const m=a(e)&&a(t);for(const r of c){const i=p(e,r),o=p(t,r);let s;if((m||"function"!=typeof i&&"function"!=typeof o)&&i!==o&&(null!=i||null!=o)){if(n&&n[r]&&"function"==typeof n[r])s=n[r]?.(i,o);else if(i instanceof Date&&o instanceof Date){if(i.getTime()===o.getTime())continue;s={type:"complete",oldValue:i,newValue:o}}else s="object"==typeof i&&"object"==typeof o&&d(i)===d(o)?u(i,o):{type:"complete",oldValue:i,newValue:o};null!=s&&(null!=f?f.diff[r]=s:f={type:"partial",diff:{[r]:s}})}}return f}function h(e,t){if(null==e)return!1;const n=t.split(".");let r=e;for(const e of n){if("complete"===r.type)return!0;if("partial"!==r.type)return!1;{const t=r.diff[e];if(!t)return!1;r=t}}return!0}function c(e,t){for(const n of t)if(h(e,n))return!0;return!1}function y(e,t){if("function"!=typeof e&&"function"!=typeof t&&(null!=e||null!=t))return null==e||null==t||"object"==typeof e&&"object"==typeof t&&d(e)!==d(t)?{type:"complete",oldValue:e,newValue:t}:u(e,t)}},24133:(e,t,n)=>{n.d(t,{Q:()=>s});var r=n(67676),i=n(44553),o=n(88764);class s{constructor(e=9,t){this._compareMinX=d,this._compareMinY=u,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),w.prune(),b.prune(),x.prune(),C.prune()}all(e){this._all(this._data,e)}search(e,t){let n=this._data;const r=this._toBBox;if(g(e,n))for(w.clear();n;){for(let i=0,o=n.children.length;i<o;i++){const o=n.children[i],s=n.leaf?r(o):o;g(e,s)&&(n.leaf?t(o):m(e,s)?this._all(o,t):w.push(o))}n=w.pop()}}collides(e){let t=this._data;const n=this._toBBox;if(!g(e,t))return!1;for(w.clear();t;){for(let r=0,i=t.children.length;r<i;r++){const i=t.children[r],o=t.leaf?n(i):i;if(g(e,o)){if(t.leaf||m(e,o))return!0;w.push(i)}}t=w.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,n=e.length;t<n;t++)this.insert(e[t]);return this}let t=this._build(e.slice(0,e.length),0,e.length-1,0);if(this._data.children.length)if(this._data.height===t.height)this._splitRoot(this._data,t);else{if(this._data.height<t.height){const e=this._data;this._data=t,t=e}this._insert(t,this._data.height-t.height-1,!0)}else this._data=t;return this}insert(e){return e&&this._insert(e,this._data.height-1),this}clear(){return this._data=new I([]),this}remove(e){if(!e)return this;let t,n,i=this._data,o=0,s=!1;const a=this._toBBox(e);for(x.clear(),C.clear();i||x.length>0;){if(i||(i=x.pop(),t=x.data.at(-1),o=C.pop()??0,s=!0),i.leaf&&(n=(0,r.cq)(i.children,e,i.children.length,i.indexHint),-1!==n))return i.children.splice(n,1),x.push(i),this._condense(x),this;s||i.leaf||!m(i,a)?t?(o++,i=t.children[o],s=!1):i=null:(x.push(i),C.push(o),o=0,t=i,i=i.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_all(e,t){let n=e;for(b.clear();n;){if(!0===n.leaf)for(const e of n.children)t(e);else b.pushArray(n.children);n=b.pop()??null}}_build(e,t,n,r){const i=n-t+1;let o=this._maxEntries;if(i<=o){const r=new I(e.slice(t,n+1));return a(r,this._toBBox),r}r||(r=Math.ceil(Math.log(i)/Math.log(o)),o=Math.ceil(i/o**(r-1)));const s=new M([]);s.height=r;const l=Math.ceil(i/o),p=l*Math.ceil(Math.sqrt(o));_(e,t,n,p,this._compareMinX);for(let i=t;i<=n;i+=p){const t=Math.min(i+p-1,n);_(e,i,t,l,this._compareMinY);for(let n=i;n<=t;n+=l){const i=Math.min(n+l-1,t);s.children.push(this._build(e,n,i,r-1))}}return a(s,this._toBBox),s}_chooseSubtree(e,t,n,r){for(;r.push(t),!0!==t.leaf&&r.length-1!==n;){let n,r=1/0,i=1/0;for(let o=0,s=t.children.length;o<s;o++){const s=t.children[o],a=h(s),l=y(e,s)-a;l<i?(i=l,r=a<r?a:r,n=s):l===i&&a<r&&(r=a,n=s)}t=n||t.children[0]}return t}_insert(e,t,n){const r=this._toBBox,i=n?e:r(e);x.clear();const o=this._chooseSubtree(i,this._data,t,x);for(o.children.push(e),p(o,i);t>=0&&x.data[t].children.length>this._maxEntries;)this._split(x,t),t--;this._adjustParentBBoxes(i,x,t)}_split(e,t){const n=e.data[t],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);const o=this._chooseSplitIndex(n,i,r);if(!o)return void console.log(" Error: assertion failed at PooledRBush._split: no valid split index");const s=n.children.splice(o,n.children.length-o),l=n.leaf?new I(s):new M(s);l.height=n.height,a(n,this._toBBox),a(l,this._toBBox),t?e.data[t-1].children.push(l):this._splitRoot(n,l)}_splitRoot(e,t){this._data=new M([e,t]),this._data.height=e.height+1,a(this._data,this._toBBox)}_chooseSplitIndex(e,t,n){let r,i,o;r=i=1/0;for(let s=t;s<=n-t;s++){const t=l(e,0,s,this._toBBox),a=l(e,s,n,this._toBBox),p=f(t,a),d=h(t)+h(a);p<r?(r=p,o=s,i=d<i?d:i):p===r&&d<i&&(i=d,o=s)}return o}_chooseSplitAxis(e,t,n){const r=e.leaf?this._compareMinX:d,i=e.leaf?this._compareMinY:u;this._allDistMargin(e,t,n,r)<this._allDistMargin(e,t,n,i)&&e.children.sort(r)}_allDistMargin(e,t,n,r){e.children.sort(r);const i=this._toBBox,o=l(e,0,t,i),s=l(e,n-t,n,i);let a=c(o)+c(s);for(let r=t;r<n-t;r++){const t=e.children[r];p(o,e.leaf?i(t):t),a+=c(o)}for(let r=n-t-1;r>=t;r--){const t=e.children[r];p(s,e.leaf?i(t):t),a+=c(s)}return a}_adjustParentBBoxes(e,t,n){for(let r=n;r>=0;r--)p(t.data[r],e)}_condense(e){for(let t=e.length-1;t>=0;t--){const n=e.data[t];if(0===n.children.length)if(t>0){const i=e.data[t-1],o=i.children;o.splice((0,r.cq)(o,n,o.length,i.indexHint),1)}else this.clear();else a(n,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this._compareMinX=new Function("a","b",t.join(e[0])),this._compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function a(e,t){l(e,0,e.children.length,t,e)}function l(e,t,n,r,i){i||(i=new I([])),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let o,s=t;s<n;s++)o=e.children[s],p(i,e.leaf?r(o):o);return i}function p(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function d(e,t){return e.minX-t.minX}function u(e,t){return e.minY-t.minY}function h(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function c(e){return e.maxX-e.minX+(e.maxY-e.minY)}function y(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function f(e,t){const n=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),i=Math.min(e.maxX,t.maxX),o=Math.min(e.maxY,t.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function m(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function g(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function _(e,t,n,r,i){const s=[t,n];for(;s.length;){const t=s.pop(),n=s.pop();if(t-n<=r)continue;const a=n+Math.ceil((t-n)/r/2)*r;(0,o.q)(e,a,n,t,i),s.push(n,a,a,t)}}const w=new i.Z,b=new i.Z,x=new i.Z,C=new i.Z({deallocator:void 0});class E{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class T extends E{constructor(){super(...arguments),this.height=1,this.indexHint=new r.SO}}class I extends T{constructor(e){super(),this.children=e,this.leaf=!0}}class M extends T{constructor(e){super(),this.children=e,this.leaf=!1}}},84864:(e,t,n)=>{n.d(t,{bU:()=>d,fC:()=>c,tp:()=>h,v7:()=>u});const r=new Float64Array(2),i=new Float64Array(2),o="0123456789bcdefghjkmnpqrstuvwxyz";function s(e){return o[e]}function a(e){return(e[0]+e[1])/2}function l(e,t,n){return e[0]=t,e[1]=n,e}function p(e,t){const n=t>a(e);return function(e,t){const n=a(e),r=t,i=!t;e[0]=i*e[0]+r*n,e[1]=i*n+r*e[1]}(e,n),n}function d(e,t){let n=-90,r=90,i=-180,o=180;for(let s=0;s<t;s++){const t=Math.ceil((s+1)/2),a=Math.floor((s+1)/2),l=1-s%2,p=30-(3*t+2*a),d=30-(2*t+3*a),u=3*l+2*(1-l),h=2*l+3*(1-l),c=3*l+7*(1-l)<<d,y=(7*l+3*(1-l)<<p&e.geohashX)>>p,f=(c&e.geohashY)>>d;for(let e=u-1;e>=0;e--){const t=(i+o)/2,n=y&1<<e?1:0;i=(1-n)*i+n*t,o=(1-n)*t+n*o}for(let e=h-1;e>=0;e--){const t=(n+r)/2,i=f&1<<e?1:0;n=(1-i)*n+i*t,r=(1-i)*t+i*r}}return[i,n,o,r]}function u(e,t,n,r){r%2&&(r+=1);let i=0,o=0,s=-90,a=90,l=-180,p=180;for(let e=0;e<r/2;e++){for(let t=0;t<5;t++){const r=(l+p)/2,o=n>r?1:0;i|=o<<29-(t+5*e),l=(1-o)*l+o*r,p=(1-o)*r+o*p}for(let n=0;n<5;n++){const r=(s+a)/2,i=t>r?1:0;o|=i<<29-(n+5*e),s=(1-i)*s+i*r,a=(1-i)*r+i*a}}e.geohashX=i,e.geohashY=o}function h(e,t,n,r,i){i%2&&(i+=1);let o=0,s=0,a=-90,l=90,p=-180,d=180;for(let e=0;e<i/2;e++){for(let t=0;t<5;t++){const n=(p+d)/2,i=r>n?1:0;o|=i<<29-(t+5*e),p=(1-i)*p+i*n,d=(1-i)*n+i*d}for(let t=0;t<5;t++){const r=(a+l)/2,i=n>r?1:0;s|=i<<29-(t+5*e),a=(1-i)*a+i*r,l=(1-i)*r+i*l}}e[2*t]=o,e[2*t+1]=s}function c(e,t,n){let o="";const a=l(r,-90,90),d=l(i,-180,180);for(let r=0;r<n;r++){let n=0;r%2?(n|=p(a,e)<<4,n|=p(d,t)<<3,n|=p(a,e)<<2,n|=p(d,t)<<1,n|=p(a,e)<<0):(n|=p(d,t)<<4,n|=p(a,e)<<3,n|=p(d,t)<<2,n|=p(a,e)<<1,n|=p(d,t)<<0),o+=s(n)}return o}},16306:(e,t,n)=>{n.d(t,{aX:()=>C});var r=n(68773),i=n(20102),o=n(92604),s=n(38913),a=n(58901),l=n(73913),p=n(8744),d=n(40488),u=(n(66577),n(3172)),h=n(33955),c=n(11282),y=n(17452);async function f(e,t,n){const r="string"==typeof e?(0,y.mN)(e):e,i=t[0].spatialReference,o=(0,h.Ji)(t[0]),s={...n,query:{...r.query,f:"json",sr:i.wkid??JSON.stringify(i),geometries:JSON.stringify((l=t,{geometryType:(0,h.Ji)(l[0]),geometries:l.map((e=>e.toJSON()))}))}},{data:a}=await(0,u.Z)(r.path+"/simplify",s);var l;return function(e,t,n){const r=(0,h.q9)(t);return e.map((e=>{const t=r.fromJSON(e);return t.spatialReference=n,t}))}(a.geometries,o,i)}const m=o.Z.getLogger("esri.geometry.support.normalizeUtils");function g(e){return"polygon"===e[0].type}function _(e){return"polyline"===e[0].type}function w(e,t,n){if(t){const t=function(e,t){if(!(e instanceof a.Z||e instanceof s.Z)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw m.error(e),new i.Z(e)}const n=(0,l.x3)(e),r=[];for(const e of n){const n=[];r.push(n),n.push([e[0][0],e[0][1]]);for(let r=0;r<e.length-1;r++){const i=e[r][0],o=e[r][1],s=e[r+1][0],a=e[r+1][1],l=Math.sqrt((s-i)*(s-i)+(a-o)*(a-o)),p=(a-o)/l,d=(s-i)/l,u=l/t;if(u>1){for(let e=1;e<=u-1;e++){const r=e*t,s=d*r+i,a=p*r+o;n.push([s,a])}const e=(l+Math.floor(u-1)*t)/2,r=d*e+i,s=p*e+o;n.push([r,s])}n.push([s,a])}}return function(e){return"polygon"===e.type}(e)?new s.Z({rings:r,spatialReference:e.spatialReference}):new a.Z({paths:r,spatialReference:e.spatialReference})}(e,1e6);e=(0,d.Sx)(t,!0)}return n&&(e=(0,l.Sy)(e,n)),e}function b(e,t,n){if(Array.isArray(e)){const r=e[0];if(r>t){const n=(0,l.XZ)(r,t);e[0]=r+n*(-2*t)}else if(r<n){const t=(0,l.XZ)(r,n);e[0]=r+t*(-2*n)}}else{const r=e.x;if(r>t){const n=(0,l.XZ)(r,t);e=e.clone().offset(n*(-2*t),0)}else if(r<n){const t=(0,l.XZ)(r,n);e=e.clone().offset(t*(-2*n),0)}}return e}function x(e,t){let n=-1;for(let r=0;r<t.cutIndexes.length;r++){const i=t.cutIndexes[r],o=t.geometries[r],s=(0,l.x3)(o);for(let e=0;e<s.length;e++){const t=s[e];t.some((n=>{if(n[0]<180)return!0;{let n=0;for(let e=0;e<t.length;e++){const r=t[e][0];n=r>n?r:n}n=Number(n.toFixed(9));const r=-360*(0,l.XZ)(n,180);for(let n=0;n<t.length;n++){const t=o.getPoint(e,n);o.setPoint(e,n,t.clone().offset(r,0))}return!0}}))}if(i===n){if(g(e))for(const t of(0,l.x3)(o))e[i]=e[i].addRing(t);else if(_(e))for(const t of(0,l.x3)(o))e[i]=e[i].addPath(t)}else n=i,e[i]=o}return e}async function C(e,t,n){if(!Array.isArray(e))return C([e],t);t&&"string"!=typeof t&&m.warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const i="string"==typeof t?t:t?.url??r.default.geometryServiceUrl;let o,y,g,_,E,T,I,M,v=0;const k=[],S=[];for(const t of e)if(null!=t)if(o||(o=t.spatialReference,y=(0,p.C5)(o),g=o.isWebMercator,T=g?102100:4326,_=l.UZ[T].maxX,E=l.UZ[T].minX,I=l.UZ[T].plus180Line,M=l.UZ[T].minus180Line),y)if("mesh"===t.type)S.push(t);else if("point"===t.type)S.push(b(t.clone(),_,E));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map((e=>b(e,_,E))),S.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,y);S.push(e.rings?new s.Z(e):e)}else if(t.extent){const e=t.extent,n=(0,l.XZ)(e.xmin,E)*(2*_);let r=0===n?t.clone():(0,l.Sy)(t.clone(),n);e.offset(n,0),e.intersects(I)&&e.xmax!==_?(v=e.xmax>v?e.xmax:v,r=w(r,g),k.push(r),S.push("cut")):e.intersects(M)&&e.xmin!==E?(v=e.xmax*(2*_)>v?e.xmax*(2*_):v,r=w(r,g,360),k.push(r),S.push("cut")):S.push(r)}else S.push(t.clone());else S.push(t);else S.push(t);let L=(0,l.XZ)(v,_),D=-90;const R=L,G=new a.Z;for(;L>0;){const e=360*L-180;G.addPath([[e,D],[e,-1*D]]),D*=-1,L--}if(k.length>0&&R>0){const t=x(k,await async function(e,t,n,r){const i=(0,c.en)(e),o=t[0].spatialReference,s={...r,query:{...i.query,f:"json",sr:JSON.stringify(o),target:JSON.stringify({geometryType:(0,h.Ji)(t[0]),geometries:t}),cutter:JSON.stringify(n)}},a=await(0,u.Z)(i.path+"/cut",s),{cutIndexes:l,geometries:p=[]}=a.data;return{cutIndexes:l,geometries:p.map((e=>{const t=(0,h.im)(e);return t.spatialReference=o,t}))}}(i,k,G,n)),r=[],o=[];for(let n=0;n<S.length;n++){const i=S[n];if("cut"!==i)o.push(i);else{const i=t.shift(),s=e[n];null!=s&&"polygon"===s.type&&s.rings&&s.rings.length>1&&i.rings.length>=s.rings.length?(r.push(i),o.push("simplify")):o.push(g?(0,d.$)(i):i)}}if(!r.length)return o;const s=await f(i,r,n),a=[];for(let e=0;e<o.length;e++){const t=o[e];"simplify"!==t?a.push(t):a.push(g?(0,d.$)(s.shift()):s.shift())}return a}const N=[];for(let e=0;e<S.length;e++){const t=S[e];if("cut"!==t)N.push(t);else{const e=k.shift();N.push(!0===g?(0,d.$)(e):e)}}return N}},73913:(e,t,n)=>{n.d(t,{Sy:()=>l,UZ:()=>s,XZ:()=>a,x3:()=>p});var r=n(58901),i=n(82971),o=n(33955);const s={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new r.Z({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:i.Z.WebMercator}),minus180Line:new r.Z({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:i.Z.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new r.Z({paths:[[[180,-180],[180,180]]],spatialReference:i.Z.WGS84}),minus180Line:new r.Z({paths:[[[-180,-180],[-180,180]]],spatialReference:i.Z.WGS84})}};function a(e,t){return Math.ceil((e-t)/(2*t))}function l(e,t){const n=p(e);for(const e of n)for(const n of e)n[0]+=t;return e}function p(e){return(0,o.oU)(e)?e.rings:e.paths}},28552:(e,t,n)=>{n.r(t),n.d(t,{default:()=>nn});var r=n(43697),i=(n(66577),n(46791)),o=n(20102),s=n(92604),a=n(95330),l=n(5600),p=(n(75215),n(67676),n(80442)),d=n(52011),u=n(84864),h=n(87085),c=n(98732),y=n(5428),f=n(92036),m=n(42033),g=n(38913),_=n(44547),w=n(8744),b=n(70272),x=n(33955);class C{constructor(){this._featureLookup=new Map}static getInstance(){return C.instance||(C.instance=new C),C.instance}static resetInstance(){C.instance&&(C.instance=null)}deleteFromStore(e){e.forEach((e=>{this._featureLookup.delete(e)}))}readFromStoreByList(e){const t=[];return e.forEach((e=>{const n=this.readFromStoreById(e);n&&t.push(n)})),t}readFromStoreById(e){return this._featureLookup.get(e)??null}writeToStore(e,t,n){const r=[];return e.forEach((e=>{if(!e||!e.id)return;e.properties||(e.properties=[]);let i,o=null;if(n&&e.properties[n]&&(o=(0,c.GH)(e.properties[n])),"originId"in e&&"destinationId"in e&&(e.properties.ESRI__ORIGIN_ID=e.originId,e.properties.ESRI__DESTINATION_ID=e.destinationId),e.properties[t]=e.id,e.id&&this._featureLookup.has(e.id)&&this._featureLookup.get(e.id).attributes){const r=this._featureLookup.get(e.id),s=JSON.parse(JSON.stringify(Object.assign(r.attributes,e.properties)));n&&e.properties[n]&&(s[n]=(0,x.im)(e.properties[n])),i=new b.u_(o?JSON.parse(JSON.stringify(o)):r?.geometry?JSON.parse(JSON.stringify(r.geometry)):null,s,null,e.properties[t])}else i=new b.u_(o?JSON.parse(JSON.stringify(o)):null,e.properties,null,e.properties[t]);this._featureLookup.set(e.id,i),r.push(i)})),r}}var E=n(40330),T=n(3172);let I=class extends f.Z{constructor(e){super(e),this.resultRows=[]}};(0,r._)([(0,l.Cb)()],I.prototype,"resultRows",void 0),I=(0,r._)([(0,d.j)("esri.rest.knowledgeGraph.GraphQueryResult")],I);const M=I;let v=class extends f.Z{constructor(e){super(e),this.resultRowsStream=new ReadableStream}};(0,r._)([(0,l.Cb)()],v.prototype,"resultRowsStream",void 0),v=(0,r._)([(0,d.j)("esri.rest.knowledgeGraph.GraphQueryResult")],v);const k=v;var S=n(96674),L=n(82971);let D=class extends S.wq{constructor(e){super(e),this.name=null,this.unique=null,this.ascending=null,this.description=null,this.fieldNames=null}};(0,r._)([(0,l.Cb)({type:String,json:{write:!0}})],D.prototype,"name",void 0),(0,r._)([(0,l.Cb)({type:Boolean,json:{write:!0}})],D.prototype,"unique",void 0),(0,r._)([(0,l.Cb)({type:Boolean,json:{write:!0}})],D.prototype,"ascending",void 0),(0,r._)([(0,l.Cb)({type:String,json:{write:!0}})],D.prototype,"description",void 0),(0,r._)([(0,l.Cb)({type:[String],json:{write:!0}})],D.prototype,"fieldNames",void 0),D=(0,r._)([(0,d.j)("esri.rest.knowledgeGraph.FieldIndex")],D);const R=D;let G=class extends S.wq{constructor(e){super(e),this.name=null,this.alias=null,this.fieldType=null,this.geometryType=null,this.hasM=null,this.hasZ=null,this.nullable=null,this.editable=null,this.required=null,this.defaultVisibility=null,this.systemMaintained=null,this.role=null,this.defaultValue=null}};(0,r._)([(0,l.Cb)({type:String,json:{write:!0}})],G.prototype,"name",void 0),(0,r._)([(0,l.Cb)({type:String,json:{write:!0}})],G.prototype,"alias",void 0),(0,r._)([(0,l.Cb)({type:String,json:{write:!0}})],G.prototype,"fieldType",void 0),(0,r._)([(0,l.Cb)({type:String,json:{write:!0}})],G.prototype,"geometryType",void 0),(0,r._)([(0,l.Cb)({type:Boolean,json:{write:!0}})],G.prototype,"hasM",void 0),(0,r._)([(0,l.Cb)({type:Boolean,json:{write:!0}})],G.prototype,"hasZ",void 0),(0,r._)([(0,l.Cb)({type:Boolean,json:{write:!0}})],G.prototype,"nullable",void 0),(0,r._)([(0,l.Cb)({type:Boolean,json:{write:!0}})],G.prototype,"editable",void 0),(0,r._)([(0,l.Cb)({type:Boolean,json:{write:!0}})],G.prototype,"required",void 0),(0,r._)([(0,l.Cb)({type:Boolean,json:{write:!0}})],G.prototype,"defaultVisibility",void 0),(0,r._)([(0,l.Cb)({type:Boolean,json:{write:!0}})],G.prototype,"systemMaintained",void 0),(0,r._)([(0,l.Cb)()],G.prototype,"role",void 0),(0,r._)([(0,l.Cb)({type:Object,json:{type:String,write:{writer:(e,t)=>{t.defaultValue=null!=e?e.toString():null}}}})],G.prototype,"defaultValue",void 0),G=(0,r._)([(0,d.j)("esri.rest.knowledgeGraph.GraphProperty")],G);const N=G;let j=class extends S.wq{constructor(e){super(e),this.name=null,this.alias=null,this.role=null,this.strict=null,this.properties=null,this.fieldIndexes=null}};(0,r._)([(0,l.Cb)({type:String,json:{write:!0}})],j.prototype,"name",void 0),(0,r._)([(0,l.Cb)({type:String,json:{write:!0}})],j.prototype,"alias",void 0),(0,r._)([(0,l.Cb)({type:String,json:{write:!0}})],j.prototype,"role",void 0),(0,r._)([(0,l.Cb)({type:Boolean,json:{write:!0}})],j.prototype,"strict",void 0),(0,r._)([(0,l.Cb)({type:[N],json:{write:!0}})],j.prototype,"properties",void 0),(0,r._)([(0,l.Cb)({type:[R],json:{write:!0}})],j.prototype,"fieldIndexes",void 0),j=(0,r._)([(0,d.j)("esri.rest.knowledgeGraph.GraphObjectType")],j);const Z=j;let O=class extends Z{constructor(e){super(e)}};O=(0,r._)([(0,d.j)("esri.rest.knowledgeGraph.EntityType")],O);const F=O;let P=class extends Z{constructor(e){super(e),this.endPoints=[]}};(0,r._)([(0,l.Cb)()],P.prototype,"endPoints",void 0),P=(0,r._)([(0,d.j)("esri.rest.knowledgeGraph.RelationshipType")],P);const A=P;let B=class extends S.wq{constructor(e){super(e),this.timestamp=null,this.spatialReference=null,this.strict=null,this.objectIdField=null,this.globalIdField=null,this.arcgisManaged=null,this.identifierInfo=null,this.searchIndexes=null,this.entityTypes=null,this.relationshipTypes=null}};(0,r._)([(0,l.Cb)({type:Date,json:{type:Number,write:{writer:(e,t)=>{t.timestamp=e?.getTime()}}}})],B.prototype,"timestamp",void 0),(0,r._)([(0,l.Cb)({type:L.Z,json:{write:!0}})],B.prototype,"spatialReference",void 0),(0,r._)([(0,l.Cb)({type:Boolean,json:{write:!0}})],B.prototype,"strict",void 0),(0,r._)([(0,l.Cb)({type:String,json:{write:!0}})],B.prototype,"objectIdField",void 0),(0,r._)([(0,l.Cb)({type:String,json:{write:!0}})],B.prototype,"globalIdField",void 0),(0,r._)([(0,l.Cb)()],B.prototype,"arcgisManaged",void 0),(0,r._)([(0,l.Cb)()],B.prototype,"identifierInfo",void 0),(0,r._)([(0,l.Cb)()],B.prototype,"searchIndexes",void 0),(0,r._)([(0,l.Cb)({type:[F],json:{write:!0}})],B.prototype,"entityTypes",void 0),(0,r._)([(0,l.Cb)({type:[A],json:{write:!0}})],B.prototype,"relationshipTypes",void 0),B=(0,r._)([(0,d.j)("esri.rest.knowledgeGraph.DataModel")],B);const z=B;let q=class extends S.wq{constructor(e){super(e),this.capabilities=[],this.supportsSearch=!1,this.supportedQueryFormats=[],this.allowGeometryUpdates=!1,this.searchMaxRecordCount=null,this.serviceCapabilities=null,this.maxRecordCount=null,this.description="",this.copyrightText="",this.units="",this.spatialReference=null,this.currentVersion=null,this.dateFieldsTimeReference=null,this.serviceItemId="",this.supportsDocuments=!1,this.dataEditingNotSupported=!1,this.schemaEditingNotSupported=!1}};(0,r._)([(0,l.Cb)({type:[String],json:{write:!0}})],q.prototype,"capabilities",void 0),(0,r._)([(0,l.Cb)({type:Boolean,json:{write:!0}})],q.prototype,"supportsSearch",void 0),(0,r._)([(0,l.Cb)({type:[String],json:{write:!0}})],q.prototype,"supportedQueryFormats",void 0),(0,r._)([(0,l.Cb)({type:Boolean,json:{write:!0}})],q.prototype,"allowGeometryUpdates",void 0),(0,r._)([(0,l.Cb)({type:Number,json:{write:!0}})],q.prototype,"searchMaxRecordCount",void 0),(0,r._)([(0,l.Cb)({type:Object,json:{write:!0}})],q.prototype,"serviceCapabilities",void 0),(0,r._)([(0,l.Cb)({type:Number,json:{write:!0}})],q.prototype,"maxRecordCount",void 0),(0,r._)([(0,l.Cb)({type:String,json:{write:!0}})],q.prototype,"description",void 0),(0,r._)([(0,l.Cb)({type:String,json:{write:!0}})],q.prototype,"copyrightText",void 0),(0,r._)([(0,l.Cb)({type:String,json:{write:!0}})],q.prototype,"units",void 0),(0,r._)([(0,l.Cb)({type:Object,json:{write:!0}})],q.prototype,"spatialReference",void 0),(0,r._)([(0,l.Cb)({type:Number,json:{write:!0}})],q.prototype,"currentVersion",void 0),(0,r._)([(0,l.Cb)({type:Object,json:{write:!0}})],q.prototype,"dateFieldsTimeReference",void 0),(0,r._)([(0,l.Cb)({type:String,json:{write:!0}})],q.prototype,"serviceItemId",void 0),(0,r._)([(0,l.Cb)({type:Boolean,json:{write:!0}})],q.prototype,"supportsDocuments",void 0),(0,r._)([(0,l.Cb)({type:Boolean,json:{write:!0}})],q.prototype,"dataEditingNotSupported",void 0),(0,r._)([(0,l.Cb)({type:Boolean,json:{write:!0}})],q.prototype,"schemaEditingNotSupported",void 0),q=(0,r._)([(0,d.j)("esri.rest.knowledgeGraph.ServiceDefinition")],q);const Y=q;let U=class extends S.wq{constructor(e){super(e),this.dataModel=null,this.serviceDefinition=null}};(0,r._)([(0,l.Cb)({type:String,json:{write:!0}})],U.prototype,"url",void 0),(0,r._)([(0,l.Cb)({type:z,json:{write:!0}})],U.prototype,"dataModel",void 0),(0,r._)([(0,l.Cb)({type:Y,json:{write:!0}})],U.prototype,"serviceDefinition",void 0),U=(0,r._)([(0,d.j)("esri.rest.knowledgeGraph.KnowledgeGraph")],U);const Q=U;var X=n(99880);const H="esri/rest/knowledgeGraph/wasmInterface/";let J,$=null;async function V(){const e=$??J;if(e)return e;const t=(0,p.Z)("wasm-simd");return J=async function(e){if(e){const{default:e}=await n.e(5389).then(n.bind(n,35389)).then((e=>e.a));return e({locateFile:e=>(0,X.V)(H+e)})}const{default:t}=await n.e(9931).then(n.bind(n,39931)).then((e=>e.a));return t({locateFile:e=>(0,X.V)(H+e)})}(t),J}var W=n(65091),K=n(94139),ee=n(58901),te=n(9361);function ne(e,t){const n=new t.ArrayValue;return n.deleteLater(),e.forEach((e=>{n.add_value(oe(e,t))})),n}function re(e,t){const n=new t.ObjectValue;n.deleteLater();for(const[r,i]of Object.entries(e))n.set_key_value(r,oe(i,t));return n}function ie(e,t){if(e instanceof W.Z)return function(e,t){const n=new t.GeometryValue;n.deleteLater(),n.geometry_type=n.geometry_type=t.esriGeometryType.esriGeometryMultipoint,n.has_z=e.hasZ,n.has_m=e.hasM;const r=[],i=[];i[0]=e.points.length;let o=0;return e.points.forEach((e=>{e.forEach((e=>{r[o]=e,o++}))})),n.coords=new Float64Array(r),n.lengths=new Uint32Array(i),n}(e,t);if(e instanceof K.Z)return function(e,t){const n=new t.GeometryValue;n.deleteLater(),n.geometry_type=t.esriGeometryType.esriGeometryPoint,n.has_z=e.hasZ,n.has_m=e.hasM;const r=[],i=[];i[0]=1,r[0]=e.x,r[1]=e.y;let o=2;return e.hasZ&&(r[o]=e.z,o++),e.hasM&&(r[o]=e.m,o++),n.coords=new Float64Array(r),n.lengths=new Uint32Array(i),n}(e,t);if(e instanceof ee.Z||e instanceof g.Z)return function(e,t){const n=new t.GeometryValue;n.deleteLater(),n.has_z=e.hasZ,n.has_m=e.hasM;const r=[],i=[];let o=[];e instanceof ee.Z?(n.geometry_type=t.esriGeometryType.esriGeometryPolyline,o=e.paths):e instanceof g.Z&&(n.geometry_type=t.esriGeometryType.esriGeometryPolygon,o=e.rings);let s=0,a=0;return o.forEach((e=>{let t=0;e.forEach((e=>{t++,e.forEach((e=>{r[a]=e,a++}))})),i[s]=t,s++})),n.coords=new Float64Array(r),n.lengths=new Uint32Array(i),n}(e,t);throw new o.Z("knowledge-graph:unsupported-geometry","Only Point, Multipoint, Polyline, and Polygon geometry are supported by ArcGIS Knowledge",{geometry:e})}function oe(e,t){if(null==e)return"";if("object"!=typeof e)return e;if(e instanceof Date)return e;if(e instanceof te.Z)return ie(e,t);if(Array.isArray(e)){const n=new t.ArrayValue;return n.deleteLater(),e.forEach((e=>{n.add_value(oe(e,t))})),n}return re(e,t)}let se=class extends S.wq{constructor(e){super(e),this.properties=null}};(0,r._)([(0,l.Cb)({json:{write:!0}})],se.prototype,"properties",void 0),se=(0,r._)([(0,d.j)("esri.rest.knowledgeGraph.GraphObject")],se);const ae=se;let le=class extends ae{constructor(e){super(e),this.typeName=null,this.id=null}};(0,r._)([(0,l.Cb)({type:String,json:{write:!0}})],le.prototype,"typeName",void 0),(0,r._)([(0,l.Cb)({type:String,json:{write:!0}})],le.prototype,"id",void 0),le=(0,r._)([(0,d.j)("esri.rest.knowledgeGraph.GraphNamedObject")],le);const pe=le;let de=class extends pe{constructor(e){super(e),this.layoutGeometry=null}};(0,r._)([(0,l.Cb)({type:K.Z,json:{write:!0}})],de.prototype,"layoutGeometry",void 0),de=(0,r._)([(0,d.j)("esri.rest.knowledgeGraph.Entity")],de);const ue=de;let he=class extends pe{constructor(e){super(e),this.originId=null,this.destinationId=null,this.layoutGeometry=null}};(0,r._)([(0,l.Cb)({type:String,json:{write:!0}})],he.prototype,"originId",void 0),(0,r._)([(0,l.Cb)({type:String,json:{write:!0}})],he.prototype,"destinationId",void 0),(0,r._)([(0,l.Cb)({type:ee.Z,json:{write:!0}})],he.prototype,"layoutGeometry",void 0),he=(0,r._)([(0,d.j)("esri.rest.Relationship.Relationship")],he);const ce=he;function ye(e,t){if(!e.typeName)throw new o.Z("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits");if(e instanceof ue){const n=new t.EntityValue;n.deleteLater(),n.type_name=e.typeName;for(const[r,i]of Object.entries(e.properties))n.set_key_value(r,fe(i,t));return e.id&&n.set_id(e.id),n}if(e instanceof ce){const n=new t.RelationshipValue;n.deleteLater(),n.type_name=e.typeName;for(const[r,i]of Object.entries(e.properties))n.set_key_value(r,fe(i,t));return e.id&&n.set_id(e.id),e.originId&&e.destinationId&&n.set_related_entity_ids(e.originId,e.destinationId),n}throw new o.Z("knowledge-graph:applyEdits-encoding-failure","Could not determine the type of a named graph object passed to the encoder")}function fe(e,t){return null==e?"":"object"!=typeof e||e instanceof Date?e:e instanceof te.Z?ie(e,t):""}let me=class extends f.Z{constructor(e){super(e),this.name=null,this.supportedCategory=null,this.analyzers=[],this.searchProperties=new Map}};(0,r._)([(0,l.Cb)()],me.prototype,"name",void 0),(0,r._)([(0,l.Cb)()],me.prototype,"supportedCategory",void 0),(0,r._)([(0,l.Cb)()],me.prototype,"analyzers",void 0),(0,r._)([(0,l.Cb)()],me.prototype,"searchProperties",void 0),me=(0,r._)([(0,d.j)("esri.rest.knowledgeGraph.SearchIndex")],me);const ge=me;var _e,we,be,xe,Ce,Ee,Te;function Ie(e){return e.deleteLater(),new F(ve(e))}function Me(e){return e.deleteLater(),new R({name:e.name,unique:e.unique,ascending:e.ascending,description:e.description,fieldNames:De(e.fields)})}function ve(e){return{name:e.name,alias:e.alias,role:_e[e.role.value]?_e[e.role.value]:null,strict:e.strict,properties:Re(e.properties),fieldIndexes:Ge(e.field_indexes)}}function ke(e){return e.deleteLater(),new N({alias:e.alias,name:e.name,fieldType:we[e.field_type.value]?we[e.field_type.value]:null,geometryType:be[e.geometry_type.value]?be[e.geometry_type.value]:null,hasM:e.has_m,hasZ:e.has_z,nullable:e.nullable,editable:e.editable,required:e.required,defaultVisibility:e.default_visibility,systemMaintained:e.system_maintained,role:Ee[e.role.value],defaultValue:e.default_value})}function Se(e){e.deleteLater();const t=ve(e),n=[];for(let t=0;t<e.end_points.size();t++){const r=e.end_points.get(t);n.push({originEntityType:r.origin_entity_type,destinationEntityType:r.dest_entity_type})}return new A(Object.assign({endPoints:n},t))}function Le(e){const t=[];for(let n=0;n<e.size();n++)t.push(Ie(e.get(n)));return t}function De(e){const t=[];for(let n=0;n<e.size();n++)t.push(e.get(n));return t}function Re(e){const t=[];for(let n=0;n<e.size();n++)t.push(ke(e.get(n)));return t}function Ge(e){const t=[];for(let n=0;n<e.size();n++)t.push(Me(e.get(n)));return t}function Ne(e){const t=[];for(let n=0;n<e.size();n++)t.push(Se(e.get(n)));return t}function je(e){const t=[];for(let n=0;n<e.size();n++){const n=new ge,r=e.get(0);n.name=r.name,n.supportedCategory=Ce[r.supported_category.value];const i=r.analyzers.size();for(let e=0;e<i;e++)n.analyzers.push({name:r.analyzers.get(e).name});for(let e=0;e<r.search_properties.keys().size();e++){const t=r.search_properties.keys().get(e),i=r.search_properties.get(t),o=[];for(let e=0;e<i.property_names.size();e++)o.push(i.property_names.get(e));n.searchProperties.set(t,{propertyNames:o})}t.push(n)}return t}!function(e){e[e.Regular=0]="Regular",e[e.Provenance=1]="Provenance",e[e.Document=2]="Document"}(_e||(_e={})),function(e){e[e.esriFieldTypeSmallInteger=0]="esriFieldTypeSmallInteger",e[e.esriFieldTypeInteger=1]="esriFieldTypeInteger",e[e.esriFieldTypeSingle=2]="esriFieldTypeSingle",e[e.esriFieldTypeDouble=3]="esriFieldTypeDouble",e[e.esriFieldTypeString=4]="esriFieldTypeString",e[e.esriFieldTypeDate=5]="esriFieldTypeDate",e[e.esriFieldTypeOID=6]="esriFieldTypeOID",e[e.esriFieldTypeGeometry=7]="esriFieldTypeGeometry",e[e.esriFieldTypeBlob=8]="esriFieldTypeBlob",e[e.esriFieldTypeRaster=9]="esriFieldTypeRaster",e[e.esriFieldTypeGUID=10]="esriFieldTypeGUID",e[e.esriFieldTypeGlobalID=11]="esriFieldTypeGlobalID",e[e.esriFieldTypeXML=12]="esriFieldTypeXML",e[e.esriFieldTypeBigInteger=13]="esriFieldTypeBigInteger"}(we||(we={})),function(e){e[e.esriGeometryNull=0]="esriGeometryNull",e[e.esriGeometryPoint=1]="esriGeometryPoint",e[e.esriGeometryMultipoint=2]="esriGeometryMultipoint",e[e.esriGeometryPolyline=3]="esriGeometryPolyline",e[e.esriGeometryPolygon=4]="esriGeometryPolygon",e[e.esriGeometryEnvelope=5]="esriGeometryEnvelope",e[e.esriGeometryAny=6]="esriGeometryAny",e[e.esriGeometryMultiPatch=7]="esriGeometryMultiPatch"}(be||(be={})),function(e){e[e.esriMethodHintUNSPECIFIED=0]="esriMethodHintUNSPECIFIED",e[e.esriUUIDESRI=1]="esriUUIDESRI",e[e.esriUUIDRFC4122=2]="esriUUIDRFC4122"}(xe||(xe={})),function(e){e[e.esriTypeUNSPECIFIED=0]="esriTypeUNSPECIFIED",e[e.esriTypeEntity=1]="esriTypeEntity",e[e.esriTypeRelationship=2]="esriTypeRelationship",e[e.esriTypeBoth=4]="esriTypeBoth"}(Ce||(Ce={})),function(e){e[e.esriGraphPropertyUNSPECIFIED=0]="esriGraphPropertyUNSPECIFIED",e[e.esriGraphPropertyRegular=1]="esriGraphPropertyRegular",e[e.esriGraphPropertyDocumentName=2]="esriGraphPropertyDocumentName",e[e.esriGraphPropertyDocumentTitle=3]="esriGraphPropertyDocumentTitle",e[e.esriGraphPropertyDocumentUrl=4]="esriGraphPropertyDocumentUrl",e[e.esriGraphPropertyDocumentText=5]="esriGraphPropertyDocumentText",e[e.esriGraphPropertyDocumentKeywords=6]="esriGraphPropertyDocumentKeywords",e[e.esriGraphPropertyDocumentContentType=7]="esriGraphPropertyDocumentContentType",e[e.esriGraphPropertyDocumentMetadata=8]="esriGraphPropertyDocumentMetadata",e[e.esriGraphPropertyDocumentFileExtension=9]="esriGraphPropertyDocumentFileExtension"}(Ee||(Ee={})),function(e){e[e.esriIdentifierInfoTypeUNSPECIFIED=0]="esriIdentifierInfoTypeUNSPECIFIED",e[e.esriIdentifierInfoTypeDatabaseNative=1]="esriIdentifierInfoTypeDatabaseNative",e[e.esriIdentifierInfoTypeUniformProperty=2]="esriIdentifierInfoTypeUniformProperty"}(Te||(Te={}));let Ze=class extends ae{constructor(e){super(e)}};Ze=(0,r._)([(0,d.j)("esri.rest.knowledgeGraph.ObjectValue")],Ze);const Oe=Ze;let Fe=class extends S.wq{constructor(e){super(e),this.path=null}};(0,r._)([(0,l.Cb)({type:[ae],json:{write:!0}})],Fe.prototype,"path",void 0),Fe=(0,r._)([(0,d.j)("esri.rest.knowledgeGraph.Path")],Fe);const Pe=Fe;var Ae,Be,ze;function qe(e){const t={},n=Ye(e,t),r=e.lengths,i=e.coords;let s="";if(e.geometry_type.value===Ae.ESRI_GEOMETRY_POLYGON)s="rings";else{if(e.geometry_type.value!==Ae.ESRI_GEOMETRY_POLYLINE)throw new o.Z("KnowledgeGraph:illegal-geometry-type","Illegal Geometry type for multipath conversion");s="paths"}t[s]=[];let a=0;return r.forEach((e=>{const r=[];for(let t=0;t<e;t++){const e=[];for(let t=0;t<n;t++)e[t]=i[a],a++;r.push(e)}t[s].push(r)})),t}function Ye(e,t){let n=2;return e.has_z?(t.hasZ=e.has_z,n++):t.hasZ=!1,e.has_m?(t.hasM=e.has_m,n++):t.hasM=!1,n}!function(e){e[e.ESRI_GEOMETRY_NULL=0]="ESRI_GEOMETRY_NULL",e[e.ESRI_GEOMETRY_POINT=1]="ESRI_GEOMETRY_POINT",e[e.ESRI_GEOMETRY_MULTIPOINT=2]="ESRI_GEOMETRY_MULTIPOINT",e[e.ESRI_GEOMETRY_POLYLINE=3]="ESRI_GEOMETRY_POLYLINE",e[e.ESRI_GEOMETRY_POLYGON=4]="ESRI_GEOMETRY_POLYGON",e[e.ESRI_GEOMETRY_ENVELOPE=5]="ESRI_GEOMETRY_ENVELOPE",e[e.ESRI_GEOMETRY_ANY=6]="ESRI_GEOMETRY_ANY",e[e.ESRI_GEOMETRY_MULTI_PATCH=7]="ESRI_GEOMETRY_MULTI_PATCH"}(Ae||(Ae={})),function(e){e[e.OBJECT=0]="OBJECT",e[e.ENTITY=1]="ENTITY",e[e.RELATIONSHIP=2]="RELATIONSHIP",e[e.PATH=3]="PATH",e[e.ARRAY=4]="ARRAY"}(Be||(Be={})),function(e){e[e.view=0]="view",e[e.edit=1]="edit"}(ze||(ze={}));const Ue=s.Z.getLogger("esri.rest.knowledgeGraph.WasmToQueryResponseObjConstructors"),Qe={decodedWasmObjToQueryResponseObj:(e,t)=>{if(null==e)return null;if("object"!=typeof e)return e;if("getDate"in e)return e;if("geometry_type"in e)switch(e.geometry_type.value){case null:return null;case Ae.ESRI_GEOMETRY_POINT:return function(e){const t={};let n=2;Ye(e,t);const r=e.coords;return t.x=r[0],t.y=r[1],e.has_z&&(t.z=r[n],n++),e.has_m&&(t.m=r[n]),new K.Z(t)}(e);case Ae.ESRI_GEOMETRY_MULTIPOINT:return function(e){const t={},n=Ye(e,t),r=e.lengths,i=e.coords,o=r[0];t.points=[];let s=0;for(let e=0;e<o;e++){const e=[];for(let t=0;t<n;t++)e[t]=i[s],s++;t.points.push(e)}return new W.Z(t)}(e);case Ae.ESRI_GEOMETRY_POLYLINE:return n=e,new ee.Z(qe(n));case Ae.ESRI_GEOMETRY_POLYGON:return function(e){return new g.Z(qe(e))}(e);case Ae.ESRI_GEOMETRY_ENVELOPE:case Ae.ESRI_GEOMETRY_MULTI_PATCH:return Ue.warnOnce("Envelope and Multipatch are not supported on knowledge entities, but one of those geometry types was detected. Result interpreted as null"),null;case Ae.ESRI_GEOMETRY_NULL:case Ae.ESRI_GEOMETRY_ANY:default:return Ue.warnOnce("Unknown or blank geometry type returned - Result interpreted as null"),null}else{if(!("object_value_type"in e))return Ue.warnOnce("A decoded value came back of a type that is not supported. Result interpreted as null"),null;switch(e.object_value_type.value){case Be.OBJECT:return function(e,t){return new Oe(Je(e,t))}(e,t);case Be.ENTITY:return He(e,t);case Be.RELATIONSHIP:return $e(e,t);case Be.PATH:return function(e,t){const n=e.entity_count(),r=e.relationship_count(),i=[];for(let o=0;o<n;o++)i.push(He(e.get_entity_at(o),t)),o<r&&i.push($e(e.get_relationship_at(o),t));return new Pe({path:i})}(e,t);case Be.ARRAY:return function(e,t){const n=[],r=e.count();for(let i=0;i<r;i++){const r=e.get_value_at(i);n.push(Xe(r,t))}return n}(e,t);default:return Ue.warnOnce("Unknown graph object type detected! Result interpreted as null"),null}}var n}};function Xe(e,t){return Qe.decodedWasmObjToQueryResponseObj(e,t)}function He(e,t){const n=e.type_name,r=Je(e,t),i=e.get_id();return new ue(Object.assign({typeName:n,id:i},r))}function Je(e,t){const n={},r=e.key_count();for(let i=0;i<r;i++)n[e.get_key_at(i)]=Xe(e.get_value_at(i),t);return{properties:n}}function $e(e,t){const n=e.type_name,r=Je(e,t);return new ce(Object.assign({typeName:n,id:e.get_id(),originId:e.get_origin_entity_id(),destinationId:e.get_destination_entity_id()},r))}let Ve=class extends f.Z{constructor(e){super(e),this.hasError=null,this.error=null,this.editResults=[]}};(0,r._)([(0,l.Cb)()],Ve.prototype,"hasError",void 0),(0,r._)([(0,l.Cb)()],Ve.prototype,"error",void 0),(0,r._)([(0,l.Cb)()],Ve.prototype,"editResults",void 0),Ve=(0,r._)([(0,d.j)("esri.rest.knowledgeGraph.GraphApplyEdits")],Ve);const We=Ve,Ke={fetchKnowledgeGraph:async e=>{const t=new Q({url:e}),n=[];return n.push(tt(t)),n.push(async function(e){return Ke.refreshServiceDefinition(e)}(t)),await Promise.all(n),t},refreshDataModel:async e=>{e.dataModel=await pt(e)},refreshServiceDefinition:async e=>{const t=(await(0,T.Z)(e.url,{query:{f:"json"}})).data;return t.capabilities=t?.capabilities?.split(","),t.supportedQueryFormats=t?.supportedQueryFormats?.split(","),e.serviceDefinition=new Y(t),e.serviceDefinition},executeQueryStreaming:async(e,t,n)=>{const r=`${e.url}/graph/query`;await rt(e);const i=await st(r,n);i.data.body=await async function(e,t){const n=await V(),r=new n.GraphQueryRequestEncoder;if(r.deleteLater(),r.output_spatial_reference=n.SpatialReferenceUtil.WGS84(),r.open_cypher_query=e.openCypherQuery,e.bindParameters)for(const[t,i]of Object.entries(e.bindParameters))ot(t,i,r,n);if(e.bindGeometryQuantizationParameters)!function(e,t){t.input_quantization_parameters={xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}(e.bindGeometryQuantizationParameters,r);else{if(t.dataModel||await tt(t),4326!==t.dataModel?.spatialReference?.wkid)throw new o.Z("knowledge-graph:SR-quantization-mismatch","If the DataModel indicates a coordinate system other than WGS84, inputQuantizationParameters must be provided to the query encoder");r.input_quantization_parameters=n.InputQuantizationUtil.WGS84_lossless()}e.outputQuantizationParameters&&function(e,t,n){if(!e.extent)throw new o.Z("knowledge-graph:illegal-output-quantization","The Output quantization provided to the encoder had an illegal value as part of its extent",e.extent);if(!e.quantizeMode)throw new o.Z("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal mode setting",e.quantizeMode);if(!e.tolerance)throw new o.Z("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal tolerance setting",e.quantizeMode);t.output_quantization_parameters={extent:{xmax:e.extent.xmax,ymax:e.extent.ymax,xmin:e.extent.xmin,ymin:e.extent.ymin},quantize_mode:n.esriQuantizeMode[e.quantizeMode],tolerance:e.tolerance}}(e.outputQuantizationParameters,r,n);try{r.encode()}catch(e){throw new o.Z("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{error:e})}const i=r.get_encoding_result();if(0!==i.error.error_code)throw new o.Z("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{errorCode:i.error.error_code,errorMessage:i.error.error_message});return i.get_byte_buffer()}(t,e);const s=await nt(i.data.url,i.data);if(e.dataModel)return new k({resultRowsStream:await lt(s,e.dataModel)});throw new o.Z("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},executeApplyEdits:async(e,t,n)=>{if(e.serviceDefinition?.dataEditingNotSupported)throw new o.Z("knowledge-graph:data-editing-not-supported","The Knowledge Graph Service definition indicated that data editing is not supported");const r=`${e.url}/graph/applyEdits`;await rt(e);const i=await st(r,n);return i.data.body=await async function(e,t){if(t.dataModel||await tt(t),!t.dataModel)throw new o.Z("knowledge-graph:data-model-undefined","Encoding could not proceed because a data model was not provided and it could not be determined from the service");const n=await V(),r=!!e.options?.cascadeDelete,i=new n.GraphApplyEditsEncoder(n.SpatialReferenceUtil.WGS84(),e.options?.inputQuantizationParameters?function(e){return{xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}(e.options?.inputQuantizationParameters):n.InputQuantizationUtil.WGS84_lossless());i.deleteLater(),i.cascade_delete=r;try{let t;e.entityAdds?.forEach((e=>{t=i.add_entity(ye(e,n)),it(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")})),e.relationshipAdds?.forEach((e=>{if(!e.originId||!e.destinationId)throw new o.Z("knowledge-graph:relationship-origin-destination-missing","When adding a new relationship, you must provide both an origin and destination id on the appropriate class property");t=i.add_relationship(ye(e,n)),it(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")})),e.entityUpdates?.forEach((e=>{if(!e.id)throw new o.Z("knowledge-graph:entity-id-missing","When updating an entity or relationship, you must specify the id on the class level property");t=i.update_entity(ye(e,n)),it(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")})),e.relationshipUpdates?.forEach((e=>{if(!e.id)throw new o.Z("knowledge-graph:relationship-id-missing","When updating an entity or relationship, you must specify the id on the class level property");t=i.update_relationship(ye(e,n)),it(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")})),e.entityDeletes?.forEach((e=>{if(!e.typeName)throw new o.Z("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const t=i.make_delete_helper(e.typeName,!0);t.deleteLater(),e.ids?.forEach((e=>{t.delete_by_id(e)}))})),e.relationshipDeletes?.forEach((e=>{if(!e.typeName)throw new o.Z("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const t=i.make_delete_helper(e.typeName,!1);e.ids?.forEach((e=>{t.delete_by_id(e)}))})),i.encode()}catch(e){throw new o.Z("knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed",{error:e})}const s=i.get_encoding_result();return it(s.error,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed"),s.get_byte_buffer()}(t,e),async function(e){const t=e.headers.get("content-type");if(t?.includes("application/x-protobuf")){const t=await e.arrayBuffer(),n=new((await V()).GraphApplyEditsDecoder);return n.deleteLater(),n.decode(new Uint8Array(t)),function(e){const t=new We;t.hasError=e.has_error(),t.hasError&&(t.error={errorCode:e.error.error_code,errorMessage:e.error.error_message});const n=e.get_edit_results_count();for(let r=0;r<n;r++){const n=e.get_edit_results_at(r),i=e.get_edit_results_type_name_at(r),o=[],s=[],a=[],l=n.get_add_results_count(),p=n.get_update_results_count(),d=n.get_delete_results_count();for(let e=0;e<l;e++){const t=n.get_add_result_at(e);o.push({id:t.id,error:{errorCode:t.error.error_code,errorMessage:t.error.error_message}})}for(let e=0;e<p;e++){const t=n.get_update_result_at(e);s.push({id:t.id,error:{errorCode:t.error.error_code,errorMessage:t.error.error_message}})}for(let e=0;e<d;e++){const t=n.get_delete_result_at(e);a.push({id:t.id,error:{errorCode:t.error.error_code,errorMessage:t.error.error_message}})}t.editResults.push({typeName:i,adds:o,updates:s,deletes:a})}return t}(n)}throw new o.Z("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:t,data:e.text()})}(await nt(i.data.url,i.data))},executeQuery:async(e,t,n)=>{const r=`${e.url}/graph/query`,i=await(0,T.Z)(r,{responseType:"array-buffer",query:{f:"pbf",openCypherQuery:t.openCypherQuery,...n?.query},signal:n?.signal,timeout:n?.timeout}),s=i.getHeader?.("content-type"),a=i.data;if(s?.includes("application/x-protobuf")){const t=new((await V()).GraphQueryDecoder);if(t.deleteLater(),e.dataModel)return new M({resultRows:at(t,a,e.dataModel)});throw new o.Z("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new o.Z("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:s,data:i.data})},executeSearch:async(e,t,n)=>{const r=t.typeCategoryFilter,i=`${e.url}/graph/search`,s=await(0,T.Z)(i,{responseType:"array-buffer",query:{f:"pbf",searchQuery:`"${t.searchQuery}"`,typeCategoryFilter:r,...n?.query},signal:n?.signal,timeout:n?.timeout}),a=s.getHeader?.("content-type"),l=s.data;if(a?.includes("application/x-protobuf")){const t=new((await V()).GraphQueryDecoder);if(t.deleteLater(),e.dataModel)return new M({resultRows:at(t,l,e.dataModel)});throw new o.Z("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new o.Z("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:a,data:s.data})},executeSearchStreaming:async(e,t,n)=>{const r=`${e.url}/graph/search`;await rt(e);const i=await st(r,n);i.data.body=await async function(e){const t=await V(),n=new t.GraphSearchRequestEncoder;if(n.deleteLater(),n.search_query=e.searchQuery,n.type_category_filter=t.esriNamedTypeCategory[e.typeCategoryFilter],!0===e.returnSearchContext&&(n.return_search_context=e.returnSearchContext),null!=e.start&&e.start>0&&(n.start_index=e.start),null!=e.num&&(n.max_num_results=e.num),null!=e.idsFilter&&Array.isArray(e.idsFilter)&&e.idsFilter.length>0)try{n.set_ids_filter(ne(e.idsFilter,t))}catch(e){throw new o.Z("knowledge-graph:ids-format-error","Attempting to set ids filter failed. This is usually caused by an incorrectly formatted UUID string",{error:e})}e.namedTypesFilter?.forEach((e=>{n.add_named_type_filter(e)}));try{n.encode()}catch(e){throw new o.Z("knowledge-graph:search-encoding-failed","Attempting to encode the search failed",{error:e})}const r=n.get_encoding_result();if(0!==r.error.error_code)throw new o.Z("knowledge-graph:search-encoding-failed","Attempting to get encoding result from the query failed",{errorCode:r.error.error_code,errorMessage:r.error.error_message});return r.get_byte_buffer()}(t);const s=await nt(i.data.url,i.data);if(e.dataModel)return new k({resultRowsStream:await lt(s,e.dataModel)});throw new o.Z("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},_fetchWrapper:async(e,t)=>fetch(e,t)};async function et(e,t,n){return Ke.executeQueryStreaming(e,t,n)}async function tt(e){return Ke.refreshDataModel(e)}async function nt(e,t){return Ke._fetchWrapper(e,t)}async function rt(e){const t=E.id?.findCredential(e.url);t||(e.dataModel?await pt(e):await tt(e))}function it(e,t,n){if(0!==e.error_code)throw new o.Z(t,n,{errorCode:e.error_code,errorMessage:e.error_message})}function ot(e,t,n,r){null==t?n.set_param_key_value(e,""):"object"!=typeof t||t instanceof Date?n.set_param_key_value(e,t):t instanceof te.Z?n.set_param_key_value(e,ie(t,r)):t instanceof Array?n.set_param_key_value(e,ne(t,r)):n.set_param_key_value(e,re(t,r))}async function st(e,t){return(0,T.Z)(e,{responseType:"native-request-init",method:"post",query:{f:"pbf",...t?.query},body:"x",headers:{"Content-Type":"application/octet-stream"},signal:t?.signal,timeout:t?.timeout})}function at(e,t,n){e.push_buffer(new Uint8Array(t));const r=[];let i=0;for(;e.next_row();){i||(i=e.get_header_keys().size());const t=new Array(i);for(let r=0;r<i;r++){const i=e.get_value(r);t[r]=Xe(i,n)}r.push(t)}if(e.has_error())throw new o.Z("knowledge-graph:stream-decoding-error","One or more result rows were not successfully decoded",{errorCode:e.error.error_code,errorMessage:e.error.error_message});return r}async function lt(e,t){const n=e.headers.get("content-type");if(e.headers.get("content-length")&&s.Z.getLogger("esri.rest.knowledgeGraph.knowledgeGraphService").warnOnce("Found `Content-Length` header when expecting a streaming HTTP response! Please investigate whether all intermediate HTTP proxies and/or load balancers are configured such that they don't forcefully buffer the entire response before returning it to the client. A valid HTTP streaming response should use Chunked Transfer Encoding and not have a Content Length defined."),n?.includes("application/x-protobuf")){const n=e.body?.getReader(),r=new((await V()).GraphQueryDecoder);return r.deleteLater(),new ReadableStream({async start(e){try{return function i(){return n?.read().then((({done:s,value:a})=>{if(s){let t;if(r.has_error()&&(t=new o.Z("knowledge-graph:stream-decoding-error","One or more result rows were not successfully decoded",{errorCode:r.error.error_code,errorMessage:r.error.error_message})),n.releaseLock(),t)throw e.error(t),t;return void e.close()}const l=at(r,a,t);return l.length>0&&e.enqueue(l),i()}))}()}catch(t){n?.releaseLock(),e.error(new o.Z("knowledge-graph:stream-decoding-error","The server returned a valid response, but there was an error decoding the response stream",{error:t})),e.close()}}})}throw new o.Z("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:n,data:e.text()})}async function pt(e){const t=`${e.url}/dataModel/queryDataModel`,n=await(0,T.Z)(t,{responseType:"array-buffer",query:{f:"pbf"}}),r=n.getHeader?.("content-type"),i=n.data;if(r?.includes("application/x-protobuf")){const e=(await V()).decode_data_model_from_protocol_buffer(new Uint8Array(i));if(!e)throw new o.Z("knowledge-graph:data-model-decode-failure","The server responded to the data model query, but the response failed to be decoded. This typically occurs when the Knowledge JS API (4.26 or later) is used with an unsupported backend (11.0 or earlier)");return function(e){return e.deleteLater(),new z({timestamp:e.timestamp,spatialReference:new L.Z(e.spatial_reference),strict:e.strict,objectIdField:e.objectid_property,globalIdField:e.globalid_property,arcgisManaged:e.arcgis_managed,identifierInfo:{identifierMappingInfo:{identifierInfoType:Te[e.identifier_info?.identifier_mapping_info?.identifier_info_type?.value],databaseNativeIdentifier:e.identifier_info?.identifier_mapping_info?.database_native_identifier,uniformPropertyIdentifier:{identifierPropertyName:e.identifier_info?.identifier_mapping_info?.uniform_property_identifier?.identifier_property_name}},identifierGenerationInfo:{uuidMethodHint:xe[e.identifier_info?.identifier_generation_info?.uuid_method_hint?.value]}},searchIndexes:je(e.search_indexes),entityTypes:Le(e.entity_types),relationshipTypes:Ne(e.relationship_types)})}(e)}throw new o.Z("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:r,data:n.data})}let dt=class extends f.Z{constructor(e){super(e),this.openCypherQuery=""}};(0,r._)([(0,l.Cb)()],dt.prototype,"openCypherQuery",void 0),dt=(0,r._)([(0,d.j)("esri.rest.knowledgeGraph.GraphQuery")],dt);const ut=dt;let ht=class extends ut{constructor(e){super(e),this.bindParameters=null,this.bindGeometryQuantizationParameters=null,this.outputQuantizationParameters=null}};(0,r._)([(0,l.Cb)()],ht.prototype,"bindParameters",void 0),(0,r._)([(0,l.Cb)()],ht.prototype,"bindGeometryQuantizationParameters",void 0),(0,r._)([(0,l.Cb)()],ht.prototype,"outputQuantizationParameters",void 0),ht=(0,r._)([(0,d.j)("esri.rest.knowledgeGraph.GraphQueryStreaming")],ht);const ct=ht;var yt=n(14165),ft=n(6570);const mt="ESRI__ID",gt="ESRI__ORIGIN_ID",_t="ESRI__DESTINATION_ID",wt="ESRI__LAYOUT_GEOMETRY",bt=12,xt=s.Z.getLogger("esri.rest.knowledgeGraph.knowledgeGraphLayer.KnowledgeGraphLayerDataManager");let Ct=class extends f.Z{constructor(e){super(e),this.inclusionModeDefinition={generateAllSublayers:!0,namedTypeDefinitions:new Map},this.entityTypeNames=new Set,this.relationshipTypeNames=new Set,this.geographicLookup=new Map,this.sublayerCaches=new Map,this._processingCacheUpdatesLookup=new Map,this._memberIdTypeLookup=new Map;const t=new Map;e.knowledgeGraph.dataModel.entityTypes?.forEach((n=>{n.name&&(t.set(n.name,"entity"),this._processingCacheUpdatesLookup.set(n.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.entityTypeNames.add(n.name),n.properties?.forEach((e=>{e.geometryType&&"esriGeometryNull"!==e.geometryType&&this.geographicLookup.set(n.name,{name:e.name??"",geometryType:e.geometryType})})))})),e.knowledgeGraph.dataModel.relationshipTypes?.forEach((n=>{n.name&&(t.set(n.name,"relationship"),this._processingCacheUpdatesLookup.set(n.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.relationshipTypeNames.add(n.name),n.properties?.forEach((e=>{e.geometryType&&"esriGeometryNull"!==e.geometryType&&this.geographicLookup.set(n.name,{name:e.name??"",geometryType:e.geometryType})})))})),e.inclusionModeDefinition?.namedTypeDefinitions.forEach(((n,r)=>{if("entity"===t.get(r))this.entityTypeNames.add(r);else{if("relationship"!==t.get(r))return xt.warn(`A named type, ${r}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(r);this.relationshipTypeNames.add(r)}const i=new Map;n.members?.forEach((e=>{this._memberIdTypeLookup.set(e.id,r);const t=this.getById(e.id);t&&i.set(e.id,t)})),this.sublayerCaches.set(r,i)}))}addToLayerInclusionSet(e){e.forEach((({typeName:e,id:t})=>{if(!this.inclusionModeDefinition)throw new o.Z("knowledge-graph:layer-data-manager","You cannot add to a layer's exclusion list if it was not created with an exclusion list originally");if(this.inclusionModeDefinition.namedTypeDefinitions.has(e)){if(this.inclusionModeDefinition.namedTypeDefinitions.has(e)){const n=this.inclusionModeDefinition.namedTypeDefinitions.get(e);n.members||(n.members=new Map),n.members.set(t,{id:t}),this._memberIdTypeLookup.set(t,e)}}else{const n=new Map;n.set(t,{id:t}),this.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:n}),this._memberIdTypeLookup.set(t,e)}}))}getById(e){return C.getInstance().readFromStoreById(e)}async getData(e,t,n){if(t.objectType.name&&this.inclusionModeDefinition?.namedTypeDefinitions&&this.inclusionModeDefinition.namedTypeDefinitions.size>0&&!this.inclusionModeDefinition.namedTypeDefinitions.has(t.objectType.name))return[];let r;if(r=e||new yt.Z({where:"1=1",outFields:["*"]}),"link-chart"===t.parentCompositeLayer.type){const e=t.parentCompositeLayer,n=this._processingCacheUpdatesLookup.get(t.objectType.name??""),i=r.outFields,o=r.geometry;let s="",a="";o&&o.extent&&(s=(0,u.fC)(o.extent.ymin,o.extent.xmin,bt),a=(0,u.fC)(o.extent.ymax,o.extent.xmax,bt)),i&&1===i.length&&i[0]===mt&&"1=1"===r.where||await Promise.all(n??[]);const l=this.sublayerCaches.has(t.objectType.name??"")?Array.from(this.sublayerCaches.get(t.objectType.name)?.values()):[],p=[];return l.forEach((n=>{if(n.geometry=e.linkChartDiagramLookup.get(n.attributes[t.objectIdField]),n.attributes[wt]=n.geometry,s&&a){const r=e.linkChartGeohashLookup.get(n.attributes[t.objectIdField]);r?r>=s&&r<=a&&p.push(n):p.push(n)}else p.push(n)})),p}return this.retrieveDataFromService(r,t,n)}async getConnectedRecordIds(e){const t=[],n=[],r=new Map;return e.forEach((e=>{if(this._memberIdTypeLookup.has(e)){const t=this._memberIdTypeLookup.get(e);if(!this.entityTypeNames.has(t))return;r.has(t)?r.get(t)?.push(e):r.set(t,[e])}})),r.forEach(((e,r)=>{const i=`MATCH (n:${r})-[r]-(m) WHERE id(n) IN $ids RETURN id(r), type(r), id(m), labels(m)[0]`,o=new Promise((n=>{(async()=>{const n=(await et(this.knowledgeGraph,new ct({openCypherQuery:i,bindParameters:{ids:e}}))).resultRowsStream.getReader();try{for(;;){const{done:e,value:r}=await n.read();if(e)break;for(let e=0;e<r.length;e++){const n=r[e];t.push({id:n[0],typeName:n[1]}),t.push({id:n[2],typeName:n[3]})}}}catch(e){if("AbortError"!==e.name)throw e;xt.info("Request aborted as expected")}})().then((()=>{n()}))}));n.push(o)})),await Promise.all(n),t}async refreshCacheContent(e,t,n,r=!0){const i=C.getInstance(),s=[],a=new Map,l=new Map;this.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&l.set(e.name,e)})),this.knowledgeGraph.dataModel.relationshipTypes?.forEach((e=>{e.name&&l.set(e.name,e)})),e||this.inclusionModeDefinition?e?e.forEach((e=>{if(this._memberIdTypeLookup.has(e)){const t=this._memberIdTypeLookup.get(e);a.has(t)?a.get(t)?.push(e):a.set(t,[e])}})):this.inclusionModeDefinition?.namedTypeDefinitions?.forEach(((e,t)=>{e.useAllData?a.set(t,null):e.members&&e.members.forEach((e=>{a.has(t)&&null!==a.get(t)?a.get(t)?.push(e.id):a.set(t,[e.id])}))})):(this.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&a.set(e.name,null)})),this.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&a.set(e.name,null)})));for(const[e,p]of a){const a=new Promise((s=>{(async()=>{const s=new Set,a=[];let d,u="",h=!1;if(t||l.get(e)?.properties?.forEach((e=>{e.name&&s.add(e.name)})),n&&this.geographicLookup.has(e)){const t=this.geographicLookup.get(e)?.name;t&&s.add(t)}if(this.entityTypeNames.has(e))u=`MATCH (n:${e}) ${p?"WHERE id(n) IN $ids ":""}return ID(n)`,s.forEach((e=>{u+=`, n.${e}`,a.push(e)}));else{if(!this.relationshipTypeNames.has(e))throw new o.Z("knowledge-graph:layer-data-manager",`The graph type of ${e} could not be determined. Was this type set in the KG data model and inclusion definition?`);h=!0,u=`MATCH ()-[n:${e}]->() ${p?"WHERE id(n) IN $ids ":""}return ID(n), id(startNode(n)), id(endNode(n))`,s.forEach((e=>{u+=`, n.${e}`,a.push(e)}))}d=new ct(p?{openCypherQuery:u,bindParameters:{ids:p}}:{openCypherQuery:u});const c=(await et(this.knowledgeGraph,d)).resultRowsStream.getReader();for(;;){const{done:t,value:n}=await c.read();if(t)break;const o=[];for(let e=0;e<n.length;e++){const t=n[e];let r=0,i=0;const s={properties:{}};for(s.id=t[r],r++,i++,h&&(s.originId=t[r],r++,i++,s.destinationId=t[r],r++,i++);r<t.length;r++)s.properties[a[r-i]]=t[r];o.push(s)}const s=i.writeToStore(o,mt,this.geographicLookup.get(e)?.name);this.sublayerCaches.has(e)||this.sublayerCaches.set(e,new Map),r&&!this.inclusionModeDefinition?.namedTypeDefinitions.has(e)&&this.inclusionModeDefinition?.namedTypeDefinitions.set(e,{useAllData:!1,members:new Map}),r&&!this.inclusionModeDefinition?.namedTypeDefinitions.get(e).members&&(this.inclusionModeDefinition.namedTypeDefinitions.get(e).members=new Map);const l=this.sublayerCaches.get(e);s.forEach((t=>{l?.set(t.attributes[mt],t),r&&!this.inclusionModeDefinition?.namedTypeDefinitions.get(e).members.has(t.attributes[mt])&&(this.inclusionModeDefinition?.namedTypeDefinitions.get(e).members.set(t.attributes[mt],{id:t.attributes[mt]}),this._memberIdTypeLookup.set(t.attributes[mt],e))}))}})().then((()=>{s(null)}))}));s.push(a),this._processingCacheUpdatesLookup.get(e)?.push(a)}await Promise.all(s)}removeFromLayer(e){const t=new Set;e.forEach((e=>{this._memberIdTypeLookup.get(e)&&t.add(this._memberIdTypeLookup.get(e)),this._memberIdTypeLookup.delete(e),this.inclusionModeDefinition?.namedTypeDefinitions.forEach((t=>{t.members?.has(e)&&t.members.delete(e)}))})),t.forEach((t=>{this.sublayerCaches.get(t)?.forEach(((n,r)=>{e.includes(r)&&this.sublayerCaches.get(t)?.delete(r)}))}))}async retrieveDataFromService(e,t,n){const r=C.getInstance(),i=new Set,s=[];let a,l="",p=[];const d="relationship"===t.graphType,u=this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData,h=t.parentCompositeLayer.sublayerIdsCache.get(t.objectType.name);let c=!u&&h?Array.from(h).sort():null;if(this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData)this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData&&null!=e.objectIds&&(c=e.objectIds);else if(null!=e.objectIds&&c&&c.length>0){const t=e.objectIds;e.objectIds=c.filter((e=>t.includes(e)))}else if(null!=e.objectIds)c=e.objectIds;else{if(this.inclusionModeDefinition?.namedTypeDefinitions.has(t.objectType.name)&&(!this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members||this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members?.size<1))return e.objectIds=[],[];e.objectIds=c}if(null!=e.outFields){const n=e.outFields;n.includes("*")?t.fields.forEach((e=>{i.add(e.name)})):n.forEach((e=>{e!==mt&&e!==t.geometryFieldName&&i.add(e)}))}if(null!=e.geometry){const n=e.geometry;let r;const p=t.parentCompositeLayer.dataManager.knowledgeGraph.serviceDefinition,u=p?.spatialReference,h=p?.serviceCapabilities?.geometryCapabilities;let c=h?.geometryMaxBoundingRectangleSizeX,y=h?.geometryMaxBoundingRectangleSizeY;if(n?.extent?.spatialReference&&!n.spatialReference?.isWGS84?(await(0,_.initializeProjection)(n.extent.spatialReference,w.Zn),r=(0,_.iV)(n.extent,w.Zn)):r=n.extent,c&&y&&u){if(4326!==u.wkid){const e=new ft.Z({spatialReference:u,xmax:c,ymax:y}),t=(0,_.iV)(e,w.Zn);c=t.xmax,y=t.ymax}if(r.xmax-r.xmin>c)throw new o.Z("knowledge-graph:layer-data-manager",`Extent x bounds should be within ${c}° latitude, limit exceeded`);if(r.ymax-r.ymin>y)throw new o.Z("knowledge-graph:layer-data-manager",`Extent y bounds should be within ${y}° longitude, limit exceeded`)}if(null!=e.where&&"1=1"!==e.where){const n=await(0,m.E)(e.where.toUpperCase(),t.fieldsIndex);t.fields.forEach((e=>{n.fieldNames.includes(e.name)&&i.add(e.name)}))}l=d?`Match ()-[n:${t.objectType.name}]->() WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n), id(startNode(r)), id(endNode(r))`:`Match (n:${t.objectType.name}) WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n)`,t.geometryFieldName&&i.add(t.geometryFieldName),i.forEach((e=>{l+=`, n.${e}`,s.push(e)})),a=new ct({openCypherQuery:l,bindParameters:{param_filter_geom:new g.Z({rings:[[[r.xmin,r.ymin],[r.xmin,r.ymax],[r.xmax,r.ymax],[r.xmax,r.ymin],[r.xmin,r.ymin]]]})}})}else{let n="";if(null!=e.where&&"1=1"!==e.where){const r=await(0,m.E)(e.where,t.fieldsIndex);t.fields.forEach((e=>{r.fieldNames.includes(e.name)&&i.add(e.name)}));const o=["column-reference","string","number","binary-expression"],s=["=","<","<=","<>",">",">=","AND","OR","LIKE"];let a=!1;const l=e=>{if("column-reference"===e.type)return`n.${e.column}`;if("string"===e.type)return`'${e.value}'`;if("number"===e.type)return`${e.value}`;if("binary-expression"===e.type&&o.includes(e.left.type)&&o.includes(e.right.type)&&s.includes(e.operator))return`${l(e.left)} ${e.operator} ${l(e.right)}`;if("binary-expression"===e.type&&"LIKE"===e.operator){let t="";if("function"===e.left.type&&"column-reference"===e.left.args.value[0].type)t+=`lower(n.${e.left.args.value[0].column})`;else{if("column-reference"!==e.left.type)return a=!0,"";t+=`lower(n.${e.left.column})`}if(t+=" CONTAINS (","string"!==e.right.type)return a=!0,"";{let n=e.right.value;"%"===n.charAt(0)&&(n=n.slice(1)),"%"===n.at(-1)&&(n=n.slice(0,-1)),t+=`'${n.toLowerCase()}')`}return t}return a=!0,""};n=l(r.parseTree),a&&(n="")}let r="";r=d?`Match ()-[n:${t.objectType.name}]->()`:`Match (n:${t.objectType.name})`;let o=!1;c&&(o=!0,r+=" WHERE ID(n) IN $ids"),n&&(r+=o?" AND":" WHERE",r+=` ${n}`),r+=" return ID(n)",d&&(r+=", id(startNode(n)), id(endNode(n))"),e.returnGeometry&&t.geometryFieldName&&i.add(t.geometryFieldName),i.forEach((e=>{r+=`, n.${e}`,s.push(e)})),a=new ct(c?{openCypherQuery:r,bindParameters:{ids:c}}:{openCypherQuery:r})}const y=(await et(t.parentCompositeLayer.dataManager.knowledgeGraph,a,n)).resultRowsStream.getReader();for(;;){const{done:e,value:n}=await y.read();if(e)break;const i=[];for(let e=0;e<n.length;e++){const t=n[e];let r=0,o=0;const a={properties:{}};for(a.id=t[r],r++,o++,d&&(a.originId=t[r],r++,o++,a.destinationId=t[r],r++,o++);r<t.length;r++)a.properties[s[r-o]]=t[r];i.push(a)}p=p.concat(r.writeToStore(i,mt,t.parentCompositeLayer.dataManager.geographicLookup.get(t.objectType.name)?.name))}return p}};(0,r._)([(0,l.Cb)()],Ct.prototype,"knowledgeGraph",void 0),(0,r._)([(0,l.Cb)()],Ct.prototype,"inclusionModeDefinition",void 0),(0,r._)([(0,l.Cb)()],Ct.prototype,"entityTypeNames",void 0),(0,r._)([(0,l.Cb)()],Ct.prototype,"relationshipTypeNames",void 0),(0,r._)([(0,l.Cb)()],Ct.prototype,"geographicLookup",void 0),(0,r._)([(0,l.Cb)()],Ct.prototype,"sublayerCaches",void 0),Ct=(0,r._)([(0,d.j)("esri.rest.knowledgeGraph.knowledgeGraphLayer.KnowledgeGraphLayerDataManager")],Ct);var Et=n(51773),Tt=(n(16050),n(12501),n(28756),n(92271),n(72529),n(5499),n(84382),n(81571),n(91423)),It=n(32400),Mt=(n(56569),n(57191)),vt=n(64106),kt=n(25278);const St=(0,n(53518).v)(),Lt=e=>{let t=class extends e{constructor(){super(...arguments),this.fields=[],this.fieldsIndex=null}};return(0,r._)([(0,l.Cb)(St.fields)],t.prototype,"fields",void 0),(0,r._)([(0,l.Cb)(St.fieldsIndex)],t.prototype,"fieldsIndex",void 0),t=(0,r._)([(0,d.j)("esri.layers.knowledgeGraphLayer.KnowledgeGraphSublayerBase")],t),t};var Dt=n(71612),Rt=n(6404),Gt=n(34760),Nt=n(72965),jt=n(1231),Zt=n(35671),Ot=n(74889),Ft=n(32163),Pt=n(728),At=n(86973);let Bt=class extends((0,Rt.M)(Lt((0,Dt.h)((0,Nt.M)((0,Gt.Q)(h.Z)))))){constructor(e){if(super(e),this.capabilities=(0,kt.MS)(!1,!1),this.definitionExpression="",this.displayField="",this.elevationInfo=null,this.geometryType=null,this.geometryFieldName=null,this.graphType=null,this.hasM=!1,this.hasZ=!1,this.labelsVisible=null,this.labelingInfo=null,this.objectIdField=mt,this.objectType=null,this.parentCompositeLayer=null,this.popupTemplate=null,this.source={openPorts:()=>this.load().then((()=>{const e=new MessageChannel;return new Pt.default(e.port1,{channel:e,client:{queryFeatures:(e,t={})=>{const n=yt.Z.fromJSON(e);return this.queryFeaturesJSON(n,t)}}},(()=>null)),[e.port2]}))},this.type="knowledge-graph-sublayer","link-chart"===e.parentCompositeLayer.type)"relationship"===e.graphType?this.geometryType="polyline":this.geometryType="point",this.geometryFieldName=wt;else if(e.parentCompositeLayer.dataManager.geographicLookup.get(e.objectType.name)?.geometryType&&"esriGeometryNull"!==e.parentCompositeLayer.dataManager.geographicLookup.get(e.objectType.name)?.geometryType){const t=e.parentCompositeLayer.dataManager.geographicLookup.get(e.objectType.name);this.geometryFieldName=t?.name??null,this.geometryType=t?.geometryType?At.M.fromJSON(t.geometryType):null;const n=t?.name,r=n?e.objectType.properties?.[n]:null;r?(this.hasM=r.hasM??!1,this.hasZ=r.hasZ??!1):(this.hasM=!1,this.hasZ=!1)}else this.geometryType=null;e.objectType.properties?.forEach((e=>{let t=e.fieldType;"esriFieldTypeOID"===t&&(t="esriFieldTypeInteger"),this.fields.push(jt.Z.fromJSON({name:e.name,type:t,alias:e.alias,defaultValue:null,editable:e.editable,nullable:e.nullable}))})),this.fields.push(jt.Z.fromJSON({name:this.objectIdField,type:"esriFieldTypeString",alias:this.objectIdField,editable:!1})),this._set("fields",[...this.fields]),e.parentCompositeLayer.dataManager.knowledgeGraph.dataModel?.spatialReference&&(this.spatialReference=e.parentCompositeLayer.dataManager.knowledgeGraph.dataModel.spatialReference),"link-chart"===e.parentCompositeLayer.type?"relationship"===e.graphType?this.renderer=(0,Tt.i)((0,kt.bU)(At.M.toJSON("polyline")).renderer):this.renderer=(0,Tt.i)((0,kt.bU)(At.M.toJSON("point")).renderer):this.renderer=(0,Tt.i)((0,kt.bU)(At.M.toJSON(this.geometryType)).renderer)}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){(0,Zt.YN)(e,this.fieldsIndex),this._set("renderer",e)}createPopupTemplate(e){return(0,Ft.eZ)(this,e)}createQuery(){return new yt.Z({where:"1=1",outFields:["*"]})}getField(e){for(let t=0;t<this.fields.length;t++)if(this.fields[t].name===e)return this.fields[t];throw new Error("Field not found")}getFieldDomain(e,t){return null}async queryFeatures(e,t){const{resolvedQuery:n,queryEngine:r}=await this._setupQueryObjects(e),i=Ot.Z.fromJSON(await r.executeQuery(n.toJSON(),t?.signal));return i.features.forEach((e=>{e.sourceLayer=this})),i}async queryFeaturesJSON(e,t){const{resolvedQuery:n,queryEngine:r}=await this._setupQueryObjects(e);return await r.executeQuery(n.toJSON(),t?.signal)}async queryFeatureCount(e,t){const{resolvedQuery:n,queryEngine:r}=await this._setupQueryObjects(e);return r.executeQueryForCount(n.toJSON(),t?.signal)}async queryExtent(e={},t){const n={...e,returnGeometry:!0},{resolvedQuery:r,queryEngine:i}=await this._setupQueryObjects(n),o=await i.executeQueryForExtent(r.toJSON(),t?.signal);let s;return s=null!=o.extent?.xmin&&null!=o.extent?.xmax&&null!=o.extent?.ymin&&null!=o.extent?.ymax?new ft.Z(o.extent):new ft.Z,{count:o.count,extent:s}}async queryObjectIds(e,t){const n=yt.Z.from(e);let r;if("link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)r=this._cachedQueryEngine;else{const e=await this.parentCompositeLayer.dataManager.getData(n,this,t);r=this.loadQueryEngine(e)}return r.executeQueryForIds(n.toJSON(),t?.signal)}loadQueryEngine(e){const t=new Mt.Z({geometryType:At.M.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),n=new vt.q({fields:this.fields.map((e=>e.toJSON())),geometryType:At.M.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,objectIdField:this.objectIdField,spatialReference:this.spatialReference.toJSON(),timeInfo:null,featureStore:t});return n.featureStore.addMany(e),n}async refreshCachedQueryEngine(){const e=await this.parentCompositeLayer.dataManager.getData(new yt.Z({where:"1=1",outFields:[mt]}),this);this._cachedQueryEngine=this.loadQueryEngine(e)}async _setupQueryObjects(e,t){const n=yt.Z.from(e),r=n.geometry;let i;if(r&&!r.spatialReference?.isWGS84&&(await(0,_.initializeProjection)(r.spatialReference,w.Zn),n.geometry=(0,_.iV)(r instanceof g.Z||r instanceof ee.Z?r:r.extent,w.Zn)),"link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)i=this._cachedQueryEngine;else{const e=await this.parentCompositeLayer.dataManager.getData(n,this,t);i=this.loadQueryEngine(e)}return{resolvedQuery:n,queryEngine:i}}};(0,r._)([(0,l.Cb)()],Bt.prototype,"capabilities",void 0),(0,r._)([(0,l.Cb)({readOnly:!0})],Bt.prototype,"defaultPopupTemplate",null),(0,r._)([(0,l.Cb)()],Bt.prototype,"definitionExpression",void 0),(0,r._)([(0,l.Cb)()],Bt.prototype,"displayField",void 0),(0,r._)([(0,l.Cb)()],Bt.prototype,"elevationInfo",void 0),(0,r._)([(0,l.Cb)()],Bt.prototype,"geometryType",void 0),(0,r._)([(0,l.Cb)()],Bt.prototype,"geometryFieldName",void 0),(0,r._)([(0,l.Cb)()],Bt.prototype,"graphType",void 0),(0,r._)([(0,l.Cb)()],Bt.prototype,"hasM",void 0),(0,r._)([(0,l.Cb)()],Bt.prototype,"hasZ",void 0),(0,r._)([(0,l.Cb)()],Bt.prototype,"labelsVisible",void 0),(0,r._)([(0,l.Cb)()],Bt.prototype,"labelingInfo",void 0),(0,r._)([(0,l.Cb)()],Bt.prototype,"objectIdField",void 0),(0,r._)([(0,l.Cb)()],Bt.prototype,"objectType",void 0),(0,r._)([(0,l.Cb)()],Bt.prototype,"parentCompositeLayer",void 0),(0,r._)([(0,l.Cb)({type:Et.Z,json:{name:"popupInfo",write:!0}})],Bt.prototype,"popupTemplate",void 0),(0,r._)([(0,l.Cb)({types:It.A,json:{write:{target:"layerDefinition.drawingInfo.renderer"}}})],Bt.prototype,"renderer",null),(0,r._)([(0,l.Cb)()],Bt.prototype,"source",void 0),(0,r._)([(0,l.Cb)({json:{read:!1}})],Bt.prototype,"type",void 0),Bt=(0,r._)([(0,d.j)("esri.layers.knowledgeGraph.KnowledgeGraphSublayer")],Bt);const zt=Bt;let qt,Yt=null;var Ut,Qt,Xt,Ht,Jt,$t,Vt,Wt,Kt;function en(e,t,n,r,i,o){const s=n.length,a=i.length,l=Float64Array.BYTES_PER_ELEMENT,p=Uint32Array.BYTES_PER_ELEMENT,d=Uint8Array.BYTES_PER_ELEMENT,u=15+s*(d+2*l)+a*(2*p),h=Yt._malloc(u);try{const d=h+16-h%16,u=d+s*l,c=u+s*l,y=c+a*p,f=y+a*p,m=()=>[Yt.HEAPF64.subarray(d>>3,(d>>3)+s),Yt.HEAPF64.subarray(u>>3,(u>>3)+s),Yt.HEAPU32.subarray(c>>2,(c>>2)+a),Yt.HEAPU32.subarray(y>>2,(y>>2)+a),Yt.HEAPU8.subarray(f,f+s)],[g,_,w,b,x]=m();g.set(n),_.set(r),w.set(i),b.set(o),x.set(t);const C=e(s,f,d,u,a,c,y),[E,T,I,M,v]=m();return n.set(E),r.set(T),i.set(I),o.set(M),t.set(v),C}finally{Yt._free(h)}}!function(e){e[e.None=0]="None",e[e.IsMovable=1]="IsMovable",e[e.IsGeographic=2]="IsGeographic",e[e.IsRoot=4]="IsRoot"}(Ut||(Ut={})),function(e){e.getMinIdealEdgeLength=function(){return Yt.getMinIdealEdgeLength()},e.apply=function(e,t,n,r,i,o=2,s=1,a=-1){return en(((e,t,n,r,i,l,p)=>Yt.applyForceDirectedLayout(e,t,n,r,i,l,p,o,s,a)),e,t,n,r,i)}}(Qt||(Qt={})),function(e){e.apply=function(e,t,n,r,i,o=2,s=1,a=-1){return en(((e,t,n,r,i,l,p)=>Yt.applyCommunityLayout(e,t,n,r,i,l,p,o,s,a)),e,t,n,r,i)}}(Xt||(Xt={})),function(e){e.apply=function(e,t,n,r,i){return en(Yt.applySimpleLayout,e,t,n,r,i)}}(Ht||(Ht={})),function(e){e.apply=function(e,t,n,r,i){return en(Yt.applyHierarchicalLayout,e,t,n,r,i)}}(Jt||(Jt={})),function(e){e.apply=function(e,t,n,r,i){return en(Yt.applyRadialTreeLayout,e,t,n,r,i)}}($t||($t={})),function(e){e.apply=function(e,t,n,r,i){return en(Yt.applySmartTreeLayout,e,t,n,r,i)}}(Vt||(Vt={})),function(e){e[e.Undirected=0]="Undirected",e[e.Directed=1]="Directed",e[e.Reversed=2]="Reversed"}(Wt||(Wt={})),function(e){e[e.ByCC_Raw=0]="ByCC_Raw",e[e.ByCC_NormalizeGlobally=1]="ByCC_NormalizeGlobally",e[e.ByCC_NormalizeByCC=2]="ByCC_NormalizeByCC"}(Kt||(Kt={}));let tn=class extends((0,Dt.h)((0,Nt.M)(h.Z))){constructor(e){if(super(e),this.dataPreloadedInLocalCache=!1,this.defaultLinkChartConfig=null,this._currentLinkChartConfig={layoutMode:"RADIAL_TREE",xScaleFactor:1,yScaleFactor:1},this._graphTypeLookup=new Map,this.knowledgeGraph=null,this.layers=new i.Z,this.linkChartDiagramLookup=new Map,this.linkChartExtent=new ft.Z({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7}),this.linkChartGeohashLookup=new Map,this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.sublayerIdsCache=new Map,this.tables=new i.Z,this.type="link-chart",this._originalInclusionList=e.inclusionModeDefinition,e.dataPreloadedInLocalCache&&!e.inclusionModeDefinition)throw new o.Z("knowledge-graph:linkchart-layer-constructor","If creating a link chart composite layer and configured that data is already loaded in the cache, you must specify an inclusion list so the Composite Layer knows what records belong to it")}normalizeCtorArgs(e){return{url:e.url,title:e.title,dataPreloadedInLocalCache:e.dataPreloadedInLocalCache,defaultLinkChartConfig:e.defaultLinkChartConfig}}_initializeLayerProperties(e){if(!this.title&&this.url){const e=this.url.split("/");this.title=e.at(-2)}const t=new Set;let n=[],r=[];if(e.inclusionModeDefinition&&(!e.inclusionModeDefinition.namedTypeDefinitions||e.inclusionModeDefinition.namedTypeDefinitions.size<1))throw new o.Z("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined");e.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&this._graphTypeLookup.set(e.name,e)})),e.knowledgeGraph.dataModel.relationshipTypes?.forEach((e=>{e.name&&this._graphTypeLookup.set(e.name,e)})),e.inclusionModeDefinition?.generateAllSublayers?(n=e.knowledgeGraph.dataModel.entityTypes??[],r=e.knowledgeGraph.dataModel.relationshipTypes??[]):e.inclusionModeDefinition?.namedTypeDefinitions&&e.inclusionModeDefinition?.namedTypeDefinitions.size>0?e.inclusionModeDefinition?.namedTypeDefinitions.forEach(((i,o)=>{if(!this._graphTypeLookup.get(o))return s.Z.getLogger(this).warn(`A named type, ${o}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(o);this._graphTypeLookup.get(o)instanceof A||"strictOrigin"in this._graphTypeLookup.get(o)?t.has(o)||(t.add(o),r.push(this._graphTypeLookup.get(o))):this._graphTypeLookup.get(o)instanceof F||"properties"in this._graphTypeLookup.get(o)?t.has(o)||(t.add(o),n.push(this._graphTypeLookup.get(o))):(s.Z.getLogger(this).warn(`A named type, ${o}, was in the inclusion list that wasn't properly modeled and will be removed`),e.inclusionModeDefinition?.namedTypeDefinitions.delete(o))})):(n=e.knowledgeGraph.dataModel.entityTypes??[],r=e.knowledgeGraph.dataModel.relationshipTypes??[]);const i=new Ct({knowledgeGraph:e.knowledgeGraph,inclusionModeDefinition:e.inclusionModeDefinition});this.knowledgeGraph=e.knowledgeGraph,this.memberEntityTypes=n,this.memberRelationshipTypes=r,this.dataManager=i}load(e){return this.addResolvingPromise(new Promise((t=>{(async function(e){return Ke.fetchKnowledgeGraph(e)})(this.url).then((n=>{if(this._initializeLayerProperties({knowledgeGraph:n,inclusionModeDefinition:this._originalInclusionList}),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.size||(this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map},this.dataManager.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})})),this.dataManager.knowledgeGraph.dataModel.relationshipTypes?.forEach((e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})}))),this.dataPreloadedInLocalCache)this.loadLayerAssumingLocalCache(),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach((e=>{e.useAllData=!1,e.members?.forEach((e=>{let t;t=e.linkChartLocation instanceof y.Z?e.linkChartLocation:e.linkChartLocation?(0,c.GH)(e.linkChartLocation):null,this.linkChartDiagramLookup.set(e.id,t),t&&2===t.coords.length&&0===t.lengths.length?this.linkChartGeohashLookup.set(e.id,(0,u.fC)(t.coords[1],t.coords[0],bt)):this.linkChartGeohashLookup.set(e.id,"")})),this.addResolvingPromise(this._initializeDiagram().then((async()=>{this.layers.forEach((async e=>{await e.refreshCachedQueryEngine()})),this.tables.forEach((async e=>{await e.refreshCachedQueryEngine()}))})))}));else{const t="GEOGRAPHIC"===this.defaultLinkChartConfig?.layoutMode;this.addResolvingPromise(this.dataManager.refreshCacheContent(void 0,!1,t,!0).then((async()=>{(0,a.k_)(e);const t=[],n=[];this.loadLayerAssumingLocalCache(),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1,this.dataManager.inclusionModeDefinition.namedTypeDefinitions.forEach((e=>{e.useAllData=!1}))),await this._initializeDiagram(),this.layers.forEach((e=>{n.push(e.refreshCachedQueryEngine()),t.push(new Promise((t=>{e.on("layerview-create",(()=>{t(null)}))})))})),this.tables.forEach((e=>{n.push(e.refreshCachedQueryEngine())})),await Promise.all(n)})))}t(null)}))}))),Promise.resolve(this)}async addRecords(e){await this._handleNewRecords(e)}async expand(e){const t=await this.dataManager.getConnectedRecordIds(e),n=t.filter((e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id)));return await this._handleNewRecords(t),{records:n}}loadLayerAssumingLocalCache(){this.memberRelationshipTypes.forEach((e=>{const t=new zt({objectType:e,parentCompositeLayer:this,graphType:"relationship",title:e.name});t.geometryType?this.layers.push(t):this.tables.push(t),this.dataManager.sublayerCaches.has(e.name)||this.dataManager.sublayerCaches.set(e.name,new Map)})),this.memberEntityTypes.forEach((e=>{const t=new zt({objectType:e,parentCompositeLayer:this,graphType:"entity",title:e.name});t.geometryType?this.layers.push(t):this.tables.push(t),this.dataManager.sublayerCaches.has(e.name)||this.dataManager.sublayerCaches.set(e.name,new Map)})),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach(((e,t)=>{const n=((e,t,n)=>(e.has(t)||e.set(t,new Set),e.get(t)))(this.sublayerIdsCache,t);e.members?.forEach((e=>{if(n.add(e.id),e.linkChartLocation)if(e.linkChartLocation instanceof y.Z)this.linkChartDiagramLookup.set(e.id,e.linkChartLocation),2===e.linkChartLocation.coords.length&&0===e.linkChartLocation.lengths.length?this.linkChartGeohashLookup.set(e.id,(0,u.fC)(e.linkChartLocation.coords[1],e.linkChartLocation.coords[0],bt)):this.linkChartGeohashLookup.set(e.id,"");else{const t=(0,c.GH)(e.linkChartLocation);this.linkChartDiagramLookup.set(e.id,e.linkChartLocation?t:null),"x"in e.linkChartLocation&&"y"in e.linkChartLocation?this.linkChartGeohashLookup.set(e.id,(0,u.fC)(e.linkChartLocation.x,e.linkChartLocation.y,bt)):this.linkChartGeohashLookup.set(e.id,"")}}))}))}async calculateLinkChartLayout(e="RADIAL_TREE",t){const r=[],i=[];this.dataManager.sublayerCaches.forEach(((e,t)=>{this.dataManager.entityTypeNames.has(t)?e.forEach((e=>{r.push({typeName:t,feature:e})})):this.dataManager.relationshipTypeNames.has(t)&&e.forEach((e=>{i.push({typeName:t,feature:e})}))})),this.linkChartDiagramLookup=new Map;const a=new Map,l=new Map,p=new Map,d=new Map,h=new Uint8Array(r.length),y=new Float64Array(r.length),f=new Float64Array(r.length),m=new Uint32Array(i.length),g=new Uint32Array(i.length),_=[],w=t?.xScaleFactor??1,b=t?.yScaleFactor??1,x=new ft.Z({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7});let C,E="FORCE_DIRECTED",T=0,I=0;switch(E="GEOGRAPHIC"===e?"FORCE_DIRECTED":e,E){case"FORCE_DIRECTED":C=Qt.apply;break;case"COMMUNITY":C=Xt.apply;break;case"HIERARCHICAL":C=Jt.apply;break;case"RADIAL_TREE":C=$t.apply;break;case"SMART_TREE":C=Vt.apply;break;default:C=Ht.apply}r.forEach((({typeName:n,feature:r})=>{if(t?.lockedNodeLocations?.has(r.attributes[mt])){"GEOGRAPHIC"===e&&this.dataManager.geographicLookup.has(n)?h[T]=Ut.IsGeographic:h[T]=Ut.None;const i=t.lockedNodeLocations.get(r.attributes[mt]);y[T]=i.x,f[T]=i.y}else if("GEOGRAPHIC"===e&&this.dataManager.geographicLookup.has(n)){h[T]=Ut.IsGeographic;let e=null;const t=r.attributes[this.dataManager.geographicLookup.get(n).name],i=this.dataManager.geographicLookup.get(n)?.geometryType;switch(i){case"esriGeometryPoint":y[T]=t?.x,f[T]=t?.y;break;case"esriGeometryPolygon":e=t?.centroid,null!=e?.x&&null!=e?.y?(y[T]=e.x,f[T]=e.y):h[T]=Ut.IsMovable;break;case"esriGeometryPolyline":case"esriGeometryMultipoint":e=t?.extent?.center,null!=e?.x&&null!=e?.y?(y[T]=e.x,f[T]=e.y):h[T]=Ut.IsMovable;break;default:h[T]=Ut.IsMovable}(null==y[T]||null==f[T]||Number.isNaN(y[T])||Number.isNaN(f[T]))&&(h[T]=Ut.IsMovable,y[T]=0,f[T]=0)}else h[T]=Ut.IsMovable,y[T]=0,f[T]=0;d.set(r.attributes[mt],T),_[T]={feature:r,typeName:n},T++}));let M=!1;if(i.forEach((e=>{const t=d.get(e.feature.attributes[gt]),n=d.get(e.feature.attributes[_t]);void 0!==t&&void 0!==n?(m[I]=t,g[I]=n,I++):(M=!0,this.linkChartDiagramLookup.set(e.feature.attributes[gt],null),this.linkChartGeohashLookup.set(e.feature.attributes[gt],null))})),M&&s.Z.getLogger(this).warn("A relationship is a member of this layer that has either origin or destination entity nodes that are not members. The diagram geometry will be set to null"),await(qt||(qt=n.e(6124).then(n.bind(n,36124)).then((e=>e.l)).then((({default:e})=>e({locateFile:e=>(0,X.V)(`esri/libs/linkchartlayout/${e}`)}))).then((e=>{!function(e){Yt=e}(e)})),qt)),!C(h,y,f,m,g))throw new o.Z("knowledge-graph:layout-failed","Attempting to arrange the records in the specified layout failed");for(let e=0;e<_.length;e++){if(h[e]===Ut.IsMovable&&(y[e]=y[e]*w,f[e]=f[e]*b),f[e]>84.9999&&(f[e]=84.9999),f[e]<-84.9999&&(f[e]=-84.9999),y[e]>179.9999&&(y[e]=179.9999),y[e]<-179.9999&&(y[e]=-179.9999),_[e].feature.attributes[wt]=new K.Z(y[e],f[e]),a.has(_[e].typeName)){const t=a.get(_[e].typeName);t?.set(_[e].feature.attributes[mt],_[e].feature)}else{const t=new Map;t.set(_[e].feature.attributes[mt],_[e].feature),a.set(_[e].typeName,t)}p.set(_[e].feature.attributes[mt],_[e].feature);const t=(0,c.GH)(_[e].feature.attributes[wt]);this.linkChartDiagramLookup.set(_[e].feature.attributes[mt],_[e].feature.attributes[wt]?t:null),this.linkChartGeohashLookup.set(_[e].feature.attributes[mt],(0,u.fC)(_[e].feature.attributes[wt].y,_[e].feature.attributes[wt].x,bt)),_[e].feature.attributes[wt].x<x.xmin&&(x.xmin=_[e].feature.attributes[wt].x),_[e].feature.attributes[wt].x>x.xmax&&(x.xmax=_[e].feature.attributes[wt].x),_[e].feature.attributes[wt].y<x.ymin&&(x.ymin=_[e].feature.attributes[wt].y),_[e].feature.attributes[wt].y>x.ymax&&(x.ymax=_[e].feature.attributes[wt].y)}return this.linkChartExtent.xmin=x.xmin,this.linkChartExtent.xmax=x.xmax,this.linkChartExtent.ymin=x.ymin,this.linkChartExtent.ymax=x.ymax,i.forEach((e=>{const t=_[d.get(e.feature.attributes[gt])]?.feature.attributes[wt],n=_[d.get(e.feature.attributes[_t])]?.feature.attributes[wt];if(!t||!n)return;const r=new ee.Z({paths:[[t.x,t.y],[n.x,n.y]]});if(e.feature.attributes[wt]=r,l.has(e.typeName)){const t=l.get(e.typeName);t?.set(e.feature.attributes[mt],e.feature)}else{const t=new Map;t.set(e.feature.attributes[mt],e.feature),l.set(e.typeName,t)}p.set(e.feature.attributes[mt],e.feature);const i=(0,c.GH)(e.feature.attributes[wt]);this.linkChartDiagramLookup.set(e.feature.attributes[mt],e.feature.attributes[wt]?i:null),this.linkChartGeohashLookup.set(e.feature.attributes[mt],"")})),this._currentLinkChartConfig={layoutMode:e,xScaleFactor:w,yScaleFactor:b},{nodes:a,links:l,idMap:p}}async applyNewLinkChartLayout(e="RADIAL_TREE",t){const n=[];await this.calculateLinkChartLayout(e,t),this.layers.forEach((e=>{n.push(e.refreshCachedQueryEngine())})),await Promise.all(n),this.layers.forEach((e=>{e.emit("refresh",{dataChanged:!0})}))}getCurrentNodeLocations(){const e=new Map;return this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((t=>{t?.members?.forEach((t=>{const n=t.linkChartLocation;let r;const i=t.id;n&&(r="x"in n?{x:n.x,y:n.y}:{x:n.coords[0],y:n.coords[1]},e.set(i,new K.Z({x:r.x,y:r.y})))}))})),e}async synchronizeInclusionListWithCache(){return new Promise((e=>{this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach(((e,t)=>{if(e.useAllData=!1,e.members&&e.members.size>0){if(!this.dataManager.sublayerCaches.get(t))return;const n=Array.from(this.dataManager.sublayerCaches.get(t).keys());Array.from(e.members.keys()).filter((e=>!n.includes(e))).forEach((t=>{e.members?.delete(t)}))}})),e()}))}async refreshLinkChartCache(e){await this.dataManager.refreshCacheContent(e);const t=[];this.layers.forEach((e=>{t.push(e.refreshCachedQueryEngine())})),await Promise.all(t),this.layers.forEach((e=>{e.emit("refresh",{dataChanged:!0})}))}async _handleNewRecords(e){const t=[];this.dataManager.addToLayerInclusionSet(e);for(const n of e)this.sublayerIdsCache.has(n.typeName)||(this.sublayerIdsCache.set(n.typeName,new Set),t.push(n.typeName)),this.sublayerIdsCache.get(n.typeName).add(n.id);for(const e of t)if(this._graphTypeLookup.has(e)){const t=this._graphTypeLookup.get(e),n="endPoints"in t?"relationship":"entity",r=new zt({objectType:t,parentCompositeLayer:this,graphType:n,title:e});"entity"===n?this.dataManager.entityTypeNames.add(e):this.dataManager.relationshipTypeNames.add(e),r.geometryType?this.layers.push(r):this.tables.push(r),this.dataManager.sublayerCaches.set(e,new Map)}await this.dataManager.refreshCacheContent(e.map((e=>e.id))),await this.applyNewLinkChartLayout(this._currentLinkChartConfig.layoutMode,{xScaleFactor:this._currentLinkChartConfig.xScaleFactor,yScaleFactor:this._currentLinkChartConfig.xScaleFactor})}async _initializeDiagram(){this.defaultLinkChartConfig?this.defaultLinkChartConfig.doNotRecalculateLayout?(this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e=>{e?.members?.forEach((e=>{const t=e.linkChartLocation;let n;const r=e.id;if(!t)return;n="x"in t?{x:t.x,y:t.y}:{x:t.coords[0],y:t.coords[1]};const i=(0,c.GH)(n);this.linkChartDiagramLookup.set(r,i),this.linkChartGeohashLookup.set(r,(0,u.fC)(n.x,n.y,bt)),this.linkChartExtent.xmin>n.x&&(this.linkChartExtent.xmin=n.x),this.linkChartExtent.xmax<n.x&&(this.linkChartExtent.xmax=n.x),this.linkChartExtent.ymin>n.y&&(this.linkChartExtent.ymin=n.y),this.linkChartExtent.ymax<n.y&&(this.linkChartExtent.ymax=n.y)}))})),this.memberRelationshipTypes.forEach((e=>{e.name&&this.dataManager.sublayerCaches.get(e.name)?.forEach((e=>{const t=this.linkChartDiagramLookup.get(e.attributes[gt]),n=this.linkChartDiagramLookup.get(e.attributes[_t]);if(t&&n){const r=(0,c.GH)(new ee.Z({paths:[[t.coords[0],t.coords[1]],[n.coords[0],n.coords[1]]]}));this.linkChartDiagramLookup.set(e.attributes[mt],r)}else this.linkChartDiagramLookup.set(e.attributes[mt],null);this.linkChartGeohashLookup.set(e.attributes[mt],"")}))}))):await this.calculateLinkChartLayout(this.defaultLinkChartConfig.layoutMode,{xScaleFactor:this.defaultLinkChartConfig.xScaleFactor,yScaleFactor:this.defaultLinkChartConfig.yScaleFactor,lockedNodeLocations:this.getCurrentNodeLocations()}):await this.calculateLinkChartLayout("RADIAL_TREE",{lockedNodeLocations:this.getCurrentNodeLocations()})}};(0,r._)([(0,l.Cb)()],tn.prototype,"dataPreloadedInLocalCache",void 0),(0,r._)([(0,l.Cb)()],tn.prototype,"defaultLinkChartConfig",void 0),(0,r._)([(0,l.Cb)()],tn.prototype,"dataManager",void 0),(0,r._)([(0,l.Cb)()],tn.prototype,"knowledgeGraph",void 0),(0,r._)([(0,l.Cb)()],tn.prototype,"layers",void 0),(0,r._)([(0,l.Cb)()],tn.prototype,"linkChartDiagramLookup",void 0),(0,r._)([(0,l.Cb)()],tn.prototype,"linkChartExtent",void 0),(0,r._)([(0,l.Cb)()],tn.prototype,"linkChartGeohashLookup",void 0),(0,r._)([(0,l.Cb)()],tn.prototype,"memberEntityTypes",void 0),(0,r._)([(0,l.Cb)()],tn.prototype,"memberRelationshipTypes",void 0),(0,r._)([(0,l.Cb)()],tn.prototype,"sublayerIdsCache",void 0),(0,r._)([(0,l.Cb)()],tn.prototype,"tables",void 0),(0,r._)([(0,l.Cb)({json:{read:!1}})],tn.prototype,"type",void 0),tn=(0,r._)([(0,d.j)("esri.layers.LinkChartLayer")],tn);const nn=tn},37549:(e,t,n)=>{n.d(t,{H:()=>a});var r=n(80442),i=n(24133),o=n(24470);const s={minX:0,minY:0,maxX:0,maxY:0};class a{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new i.Q(9,(0,r.Z)("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach(((n,r)=>{e[t++]=r})),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter((e=>this._idByBounds.has(e)))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const e=(0,o.cS)();for(const t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),function(e,t,n){(function(e){s.minX=e[0],s.minY=e[1],s.maxX=e[2],s.maxY=e[3]})(t),e.search(s,n)}(this._index,e,(e=>t(this._idByBounds.get(e))))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){const t=this._boundsById.get(e);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},57191:(e,t,n)=>{n.d(t,{Z:()=>m});var r=n(20102),i=n(32448),o=n(92604),s=n(60437),a=n(24470),l=n(98732),p=n(37549),d=n(29730),u=n(70272),h=n(5428);const c={getObjectId:e=>e.objectId,getAttributes:e=>e.attributes,getAttribute:(e,t)=>e.attributes[t],cloneWithGeometry:(e,t)=>new u.u_(t,e.attributes,null,e.objectId),getGeometry:e=>e.geometry,getCentroid:(e,t)=>(null==e.centroid&&(e.centroid=(0,d.Y)(new h.Z,e.geometry,t.hasZ,t.hasM)),e.centroid)};var y=n(11490);const f=(0,s.Ue)();class m{constructor(e){this.geometryInfo=e,this._boundsStore=new p.H,this._featuresById=new Map,this._markedIds=new Set,this.events=new i.Z,this.featureAdapter=c}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let e=0;return this._featuresById.forEach((t=>{null!=t.geometry&&t.geometry.coords&&(e+=t.geometry.coords.length)})),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(e){if(null==this.fullBounds)return null;const[t,n,r,i]=this.fullBounds;return{xmin:t,ymin:n,xmax:r,ymax:i,spatialReference:(0,y.S2)(e)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(e){const t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const t of e){const e=this._featuresById.get(t);e&&this._remove(e)}this._emitChanged()}forEachBounds(e,t){for(const n of e){const e=this._boundsStore.get(n.objectId);e&&t((0,s.JR)(f,e))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach((t=>e(t)))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,(e=>{t(this._featuresById.get(e))}))}startMarkingUsedFeatures(){this._boundsStore.invalidateIndex(),this._markedIds.clear()}sweep(){let e=!1;this._featuresById.forEach(((t,n)=>{this._markedIds.has(n)||(e=!0,this._remove(t))})),this._markedIds.clear(),e&&this._emitChanged()}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const t=e.objectId;if(null==t)return void o.Z.getLogger("esri.layers.graphics.data.FeatureStore").error(new r.Z("featurestore:invalid-feature","feature id is missing",{feature:e}));const n=this._featuresById.get(t);let i;if(this._markedIds.add(t),n?(e.displayId=n.displayId,i=this._boundsStore.get(t),this._boundsStore.delete(t)):null!=this.onFeatureAdd&&this.onFeatureAdd(e),null==e.geometry||!e.geometry.coords||!e.geometry.coords.length)return this._boundsStore.set(t,null),void this._featuresById.set(t,e);i=(0,l.$)(null!=i?i:(0,a.Ue)(),e.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),null!=i&&this._boundsStore.set(t,i),this._featuresById.set(t,e)}_remove(e){null!=this.onFeatureRemove&&this.onFeatureRemove(e);const t=e.objectId;return this._markedIds.delete(t),this._boundsStore.delete(t),this._featuresById.delete(t),e}}},25278:(e,t,n)=>{n.d(t,{Dm:()=>d,Hq:()=>u,MS:()=>h,bU:()=>a});var r=n(80442),i=n(22974),o=n(61159),s=n(58333);function a(e){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===e||"esriGeometryMultipoint"===e?s.I4:"esriGeometryPolyline"===e?s.ET:s.lF}}}const l=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let p=1;function d(e,t){if((0,r.Z)("esri-csp-restrictions"))return()=>({[t]:null,...e});try{let n=`this.${t} = null;`;for(const t in e)n+=`this${l.test(t)?`.${t}`:`["${t}"]`} = ${JSON.stringify(e[t])};`;const r=new Function(`\n return class AttributesClass$${p++} {\n constructor() {\n ${n};\n }\n }\n `)();return()=>new r}catch(n){return()=>({[t]:null,...e})}}function u(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,i.d9)(e)}}]}function h(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:t,supportsDelete:t,supportsEditing:t,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:t,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:o.g,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsGeometryUpdate:t,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1}}}},21506:(e,t,n)=>{n.d(t,{qG:()=>b,PV:()=>f,id:()=>C,iR:()=>h,rn:()=>y,rT:()=>I,u1:()=>T,rO:()=>E,Oh:()=>_,bT:()=>w,C_:()=>u,Lx:()=>m,vg:()=>x,YI:()=>d,HQ:()=>c});var r=n(92835),i=n(6570),o=n(82971),s=n(25929),a=(n(67676),n(35463)),l=n(86787),p=n(65242);const d={type:Boolean,value:!0,json:{origins:{service:{read:!1,write:!1},"web-map":{read:!1,write:!1}},name:"screenSizePerspective",write:!0}},u={type:Boolean,value:!0,json:{name:"disablePopup",read:{reader:(e,t)=>!t.disablePopup},write:{enabled:!0,writer(e,t,n){t[n]=!e}}}},h={type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",write:!0}},c={type:String,json:{origins:{"portal-item":{write:!1}},write:{isRequired:!0,ignoreOrigin:!0,writer:s.w}}},y={type:Boolean,value:!0,nonNullable:!0,json:{origins:{service:{read:{enabled:!1}}},name:"showLegend",write:!0}},f={value:null,type:l.Z,json:{origins:{service:{name:"elevationInfo",write:!0}},name:"layerDefinition.elevationInfo",write:!0}};function m(e){return{type:e,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}}}const g={write:!0,read:!0},_={type:Number,json:{origins:{"web-document":g,"portal-item":{write:!0}}}},w={..._,json:{..._.json,origins:{"web-document":{...g,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}}}},read:{source:["layerDefinition.drawingInfo.transparency","drawingInfo.transparency"],reader:(e,t,n)=>n&&"service"!==n.origin||!t.drawingInfo||void 0===t.drawingInfo.transparency?t.layerDefinition&&t.layerDefinition.drawingInfo&&void 0!==t.layerDefinition.drawingInfo.transparency?(0,p.b)(t.layerDefinition.drawingInfo.transparency):void 0:(0,p.b)(t.drawingInfo.transparency)}}},b={type:r.Z,readOnly:!0,get(){if(!this.layer?.timeInfo)return null;const{datesInUnknownTimezone:e,timeOffset:t,useViewTime:n}=this.layer,i=this.view?.timeExtent;let o=this.layer.timeExtent;e&&(o=function(e){if(!e)return e;const{start:t,end:n}=e;return new r.Z({start:null!=t?(0,a.Nm)(t,t.getTimezoneOffset(),"minutes"):t,end:null!=n?(0,a.Nm)(n,n.getTimezoneOffset(),"minutes"):n})}(o));let s=n?i&&o?i.intersection(o):i||o:o;if(!s||s.isEmpty||s.isAllTime)return s;t&&(s=s.offset(-t.value,t.unit)),e&&(s=function(e){if(!e)return e;const{start:t,end:n}=e;return new r.Z({start:null!=t?(0,a.Nm)(t,-t.getTimezoneOffset(),"minutes"):t,end:null!=n?(0,a.Nm)(n,-n.getTimezoneOffset(),"minutes"):n})}(s));const l=this._get("timeExtent");return s.equals(l)?l:s}},x={type:i.Z,readOnly:!0,json:{origins:{service:{read:{source:["fullExtent","spatialReference"],reader:(e,t)=>{const n=i.Z.fromJSON(e);return null!=t.spatialReference&&"object"==typeof t.spatialReference&&(n.spatialReference=o.Z.fromJSON(t.spatialReference)),n}}}},read:!1}},C={type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}}}},E={type:Number,json:{origins:{service:{write:{enabled:!1}}},read:{source:"layerDefinition.minScale"},write:{target:"layerDefinition.minScale"}}},T={type:Number,json:{origins:{service:{write:{enabled:!1}}},read:{source:"layerDefinition.maxScale"},write:{target:"layerDefinition.maxScale"}}},I={json:{write:{ignoreOrigin:!0},origins:{"web-map":{read:!1,write:!1}}}}},99282:(e,t,n)=>{n.d(t,{a:()=>o});var r=n(67900),i=n(68441);const o={unknown:1,inches:(0,r.En)(1,"meters","inches"),feet:(0,r.En)(1,"meters","feet"),"us-feet":(0,r.En)(1,"meters","us-feet"),yards:(0,r.En)(1,"meters","yards"),miles:(0,r.En)(1,"meters","miles"),"nautical-miles":(0,r.En)(1,"meters","nautical-miles"),millimeters:(0,r.En)(1,"meters","millimeters"),centimeters:(0,r.En)(1,"meters","centimeters"),decimeters:(0,r.En)(1,"meters","decimeters"),meters:(0,r.En)(1,"meters","meters"),kilometers:(0,r.En)(1,"meters","kilometers"),"decimal-degrees":1/(0,r.ty)(1,"meters",i.sv.radius)}},74889:(e,t,n)=>{n.d(t,{Z:()=>w});var r,i=n(43697),o=n(66577),s=n(38171),a=n(35454),l=n(96674),p=n(22974),d=n(5600),u=(n(75215),n(71715)),h=n(52011),c=n(30556),y=n(82971),f=n(33955),m=n(1231);const g=new a.X({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let _=r=class extends l.wq{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){const n=y.Z.fromJSON(t.spatialReference),r=[];for(let t=0;t<e.length;t++){const i=e[t],o=s.Z.fromJSON(i),a=i.geometry&&i.geometry.spatialReference;null==o.geometry||a||(o.geometry.spatialReference=n);const l=i.aggregateGeometries,p=o.aggregateGeometries;if(l&&null!=p)for(const e in p){const t=p[e],r=l[e],i=r?.spatialReference;null==t||i||(t.spatialReference=n)}r.push(o)}return r}writeGeometryType(e,t,n,r){if(e)return void g.write(e,t,n,r);const{features:i}=this;if(i)for(const e of i)if(e&&null!=e.geometry)return void g.write(e.geometry.type,t,n,r)}readQueryGeometry(e,t){if(!e)return null;const n=!!e.spatialReference,r=(0,f.im)(e);return r&&!n&&t.spatialReference&&(r.spatialReference=y.Z.fromJSON(t.spatialReference)),r}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:n}=this;if(n)for(const e of n)if(e&&null!=e.geometry&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new r(this.cloneProperties())}cloneProperties(){return(0,p.d9)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let n=0;n<t.features.length;n++){const r=t.features[n];if(r.geometry){const t=e&&e[n];r.geometry=t&&t.toJSON()||r.geometry}}return t}quantize(e){const{scale:[t,n],translate:[r,i]}=e,o=this.features,s=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-r)/t)),(e=>Math.round((i-e)/n)));for(let e=0,t=o.length;e<t;e++)s?.(o[e].geometry)||(o.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:n}=this;if(!n)return this;const{translate:[r,i],scale:[o,s]}=n;let a=null,l=null;if(this.hasZ&&null!=n?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=n;a=n=>n*t+e}if(this.hasM&&null!=n?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=n;l=n=>null==n?n:n*t+e}const p=this._getHydrationFunction(e,(e=>e*o+r),(e=>i-e*s),a,l);for(const{geometry:e}of t)null!=e&&p&&p(e);return this.transform=null,this}_quantizePoints(e,t,n){let r,i;const o=[];for(let s=0,a=e.length;s<a;s++){const a=e[s];if(s>0){const e=t(a[0]),s=n(a[1]);e===r&&s===i||(o.push([e-r,s-i]),r=e,i=s)}else r=t(a[0]),i=n(a[1]),o.push([r,i])}return o.length>0?o:null}_getQuantizationFunction(e,t,n){return"point"===e?e=>(e.x=t(e.x),e.y=n(e.y),e):"polyline"===e||"polygon"===e?e=>{const r=(0,f.oU)(e)?e.rings:e.paths,i=[];for(let e=0,o=r.length;e<o;e++){const o=r[e],s=this._quantizePoints(o,t,n);s&&i.push(s)}return i.length>0?((0,f.oU)(e)?e.rings=i:e.paths=i,e):null}:"multipoint"===e?e=>{const r=this._quantizePoints(e.points,t,n);return r&&r.length>0?(e.points=r,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,n,r,i){return"point"===e?e=>{e.x=t(e.x),e.y=n(e.y),r&&(e.z=r(e.z))}:"polyline"===e||"polygon"===e?e=>{const o=(0,f.oU)(e)?e.rings:e.paths;let s,a;for(let e=0,r=o.length;e<r;e++){const r=o[e];for(let e=0,i=r.length;e<i;e++){const i=r[e];e>0?(s+=i[0],a+=i[1]):(s=i[0],a=i[1]),i[0]=t(s),i[1]=n(a)}}if(r&&i)for(let e=0,t=o.length;e<t;e++){const t=o[e];for(let e=0,n=t.length;e<n;e++){const n=t[e];n[2]=r(n[2]),n[3]=i(n[3])}}else if(r)for(let e=0,t=o.length;e<t;e++){const t=o[e];for(let e=0,n=t.length;e<n;e++){const n=t[e];n[2]=r(n[2])}}else if(i)for(let e=0,t=o.length;e<t;e++){const t=o[e];for(let e=0,n=t.length;e<n;e++){const n=t[e];n[2]=i(n[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=n(e.ymin),e.xmax=t(e.xmax),e.ymax=n(e.ymax),r&&null!=e.zmax&&null!=e.zmin&&(e.zmax=r(e.zmax),e.zmin=r(e.zmin)),i&&null!=e.mmax&&null!=e.mmin&&(e.mmax=i(e.mmax),e.mmin=i(e.mmin))}:"multipoint"===e?e=>{const o=e.points;let s,a;for(let e=0,r=o.length;e<r;e++){const r=o[e];e>0?(s+=r[0],a+=r[1]):(s=r[0],a=r[1]),r[0]=t(s),r[1]=n(a)}if(r&&i)for(let e=0,t=o.length;e<t;e++){const t=o[e];t[2]=r(t[2]),t[3]=i(t[3])}else if(r)for(let e=0,t=o.length;e<t;e++){const t=o[e];t[2]=r(t[2])}else if(i)for(let e=0,t=o.length;e<t;e++){const t=o[e];t[2]=i(t[2])}}:null}};(0,i._)([(0,d.Cb)({type:String,json:{write:!0}})],_.prototype,"displayFieldName",void 0),(0,i._)([(0,d.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],_.prototype,"exceededTransferLimit",void 0),(0,i._)([(0,d.Cb)({type:[s.Z],json:{write:!0}})],_.prototype,"features",void 0),(0,i._)([(0,u.r)("features")],_.prototype,"readFeatures",null),(0,i._)([(0,d.Cb)({type:[m.Z],json:{write:!0}})],_.prototype,"fields",void 0),(0,i._)([(0,d.Cb)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:g.read}}})],_.prototype,"geometryType",void 0),(0,i._)([(0,c.c)("geometryType")],_.prototype,"writeGeometryType",null),(0,i._)([(0,d.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],_.prototype,"hasM",void 0),(0,i._)([(0,d.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],_.prototype,"hasZ",void 0),(0,i._)([(0,d.Cb)({types:o.qM,json:{write:!0}})],_.prototype,"queryGeometry",void 0),(0,i._)([(0,u.r)("queryGeometry")],_.prototype,"readQueryGeometry",null),(0,i._)([(0,d.Cb)({type:y.Z,json:{write:!0}})],_.prototype,"spatialReference",void 0),(0,i._)([(0,c.c)("spatialReference")],_.prototype,"writeSpatialReference",null),(0,i._)([(0,d.Cb)({json:{write:!0}})],_.prototype,"transform",void 0),_=r=(0,i._)([(0,h.j)("esri.rest.support.FeatureSet")],_),_.prototype.toJSON.isDefaultToJSON=!0;const w=_},11282:(e,t,n)=>{n.d(t,{cv:()=>a,en:()=>s,lA:()=>o}),n(68773),n(40330);var r=n(22974),i=n(17452);function o(e,t){return t?{...t,query:{...e??{},...t.query}}:{query:e}}function s(e){return"string"==typeof e?(0,i.mN)(e):(0,r.d9)(e)}function a(e,t,n){const r={};for(const i in e){if("declaredClass"===i)continue;const o=e[i];if(null!=o&&"function"!=typeof o)if(Array.isArray(o)){r[i]=[];for(let e=0;e<o.length;e++)r[i][e]=a(o[e])}else if("object"==typeof o)if(o.toJSON){const e=o.toJSON(n&&n[i]);r[i]=t?e:JSON.stringify(e)}else r[i]=t?o:JSON.stringify(o);else r[i]=o}return r}n(71058)},86787:(e,t,n)=>{n.d(t,{Z:()=>b});var r,i=n(43697),o=n(35454),s=n(96674),a=n(70586),l=n(5600),p=(n(75215),n(67676),n(80442),n(71715)),d=n(52011),u=n(30556),h=n(35671);let c=r=class extends s.wq{constructor(e){super(e)}async collectRequiredFields(e,t){return(0,h.io)(e,t,this.expression)}clone(){return new r({expression:this.expression,title:this.title})}equals(e){return this.expression===e.expression&&this.title===e.title}};(0,i._)([(0,l.Cb)({type:String,json:{write:!0}})],c.prototype,"expression",void 0),(0,i._)([(0,l.Cb)({type:String,json:{write:!0}})],c.prototype,"title",void 0),c=r=(0,i._)([(0,d.j)("esri.layers.support.FeatureExpressionInfo")],c);const y=c;var f,m=n(12541);const g=(0,o.w)()({onTheGround:"on-the-ground",relativeToGround:"relative-to-ground",relativeToScene:"relative-to-scene",absoluteHeight:"absolute-height"}),_=new o.X({foot:"feet",kilometer:"kilometers",meter:"meters",mile:"miles","us-foot":"us-feet",yard:"yards"});let w=f=class extends s.wq{constructor(e){super(e),this.offset=null}readFeatureExpressionInfo(e,t){return null!=e?e:t.featureExpression&&0===t.featureExpression.value?{expression:"0"}:void 0}writeFeatureExpressionInfo(e,t,n,r){t[n]=e.write({},r),"0"===e.expression&&(t.featureExpression={value:0})}get mode(){const{offset:e,featureExpressionInfo:t}=this;return this._isOverridden("mode")?this._get("mode"):null!=e||t?"relative-to-ground":"on-the-ground"}set mode(e){this._override("mode",e)}set unit(e){this._set("unit",e)}write(e,t){return this.offset||this.mode||this.featureExpressionInfo||this.unit?super.write(e,t):null}clone(){return new f({mode:this.mode,offset:this.offset,featureExpressionInfo:this.featureExpressionInfo?this.featureExpressionInfo.clone():void 0,unit:this.unit})}equals(e){return this.mode===e.mode&&this.offset===e.offset&&this.unit===e.unit&&(0,a._W)(this.featureExpressionInfo,e.featureExpressionInfo)}};(0,i._)([(0,l.Cb)({type:y,json:{write:!0}})],w.prototype,"featureExpressionInfo",void 0),(0,i._)([(0,p.r)("featureExpressionInfo",["featureExpressionInfo","featureExpression"])],w.prototype,"readFeatureExpressionInfo",null),(0,i._)([(0,u.c)("featureExpressionInfo",{featureExpressionInfo:{type:y},"featureExpression.value":{type:[0]}})],w.prototype,"writeFeatureExpressionInfo",null),(0,i._)([(0,l.Cb)({type:g.apiValues,nonNullable:!0,json:{type:g.jsonValues,read:g.read,write:{writer:g.write,isRequired:!0}}})],w.prototype,"mode",null),(0,i._)([(0,l.Cb)({type:Number,json:{write:!0}})],w.prototype,"offset",void 0),(0,i._)([(0,l.Cb)({type:m.f9,json:{type:String,read:_.read,write:_.write}})],w.prototype,"unit",null),w=f=(0,i._)([(0,d.j)("esri.layers.support.ElevationInfo")],w);const b=w},58333:(e,t,n)=>{n.d(t,{ET:()=>o,I4:()=>i,eG:()=>l,lF:()=>s,lj:()=>d,qP:()=>a,wW:()=>p});const r=[252,146,31,255],i={type:"esriSMS",style:"esriSMSCircle",size:6,color:r,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},o={type:"esriSLS",style:"esriSLSSolid",width:.75,color:r},s={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},a={type:"esriTS",color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},horizontalAlignment:"center",kerning:!0,haloColor:[0,0,0,255],haloSize:1,rotated:!1,text:"",xoffset:0,yoffset:0,angle:0},l={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},p={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},d={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null}},12541:(e,t,n)=>{n.d(t,{Z7:()=>i,f9:()=>o});var r=n(99282);function i(e){return 1/(r.a[e]||1)}const o=function(){const e=Object.keys(r.a);return e.sort(),e}()},65242:(e,t,n)=>{n.d(t,{a:()=>i,b:()=>o});var r=n(75215);function i(e){const t=(0,r.vU)(100*(1-e));return Math.max(0,Math.min(t,100))}function o(e){const t=1-e/100;return Math.max(0,Math.min(t,1))}}}]);
|