@arcgis/core 4.33.0-next.20250219 → 4.33.0-next.20250221
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/applications/ExperienceBuilder/sketchUtils.d.ts +1 -0
- package/applications/ExperienceBuilder/sketchUtils.js +1 -1
- package/arcade/featureSetUtils.js +1 -1
- package/arcade/functions/featuresetbase.js +1 -1
- package/arcade/treeAnalysis.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0c3930e40fc9f8a84599.js +2 -0
- package/assets/esri/core/workers/chunks/{ccee343fb8c415b59ce3.js.LICENSE.txt → 0c3930e40fc9f8a84599.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/333bb93a28209c997d8b.js +314 -0
- package/assets/esri/core/workers/chunks/469c50c49447f0d602c0.js +1 -0
- package/assets/esri/core/workers/chunks/486df1e042204b90b0dd.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/4f764b952c6463fc7c88.js +1 -0
- package/assets/esri/core/workers/chunks/{c2d539359f321bba3432.js → 52c13b3c074c9f6dadde.js} +2 -2
- package/assets/esri/core/workers/chunks/{c2d539359f321bba3432.js.LICENSE.txt → 52c13b3c074c9f6dadde.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/5693d9ce4472a4c5959f.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/5b56b271afb0fadf48b4.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/63d8d507f073a8ed42d2.js +1 -0
- package/assets/esri/core/workers/chunks/6518954889df2e781c47.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/68322a63ec92d33701ea.js +1 -0
- package/assets/esri/core/workers/chunks/70574e0e3de729187d98.js +1 -0
- package/assets/esri/core/workers/chunks/78c066e8fe167d4ab817.js +1 -0
- package/assets/esri/core/workers/chunks/875a200f215e472d147e.js +1 -0
- package/assets/esri/core/workers/chunks/{f976233ad5e5b718ba83.js → 8d1f49927738ad3601d2.js} +1 -1
- package/assets/esri/core/workers/chunks/9050dad7e4f093568026.js +1 -0
- package/assets/esri/core/workers/chunks/930544d3b2c1d9c035c7.js +1 -0
- package/assets/esri/core/workers/chunks/{962cad03be1b7aa52ebe.js → 95835a62712fe4f24205.js} +1 -1
- package/assets/esri/core/workers/chunks/{030384851fa745908a6e.js → 9dbdb88cdac993104740.js} +2 -2
- package/assets/esri/core/workers/chunks/aacebda644be06ad1a61.js +1 -0
- package/assets/esri/core/workers/chunks/b0952b81d5be214262dd.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/b7c6d0ff4c085c8d0596.js +1 -0
- package/assets/esri/core/workers/chunks/e0cd4815149d1ff4d31e.js +1 -0
- package/assets/esri/core/workers/chunks/e2df18662cc4d6e47715.js +1 -0
- package/assets/esri/core/workers/chunks/{0a82c13828ffd4780419.js → f51fc2370fb486233499.js} +1 -1
- package/assets/esri/core/workers/chunks/fcbe65256a71b34ac9cf.js +1 -0
- package/assets/esri/themes/base/widgets/_Editor.scss +7 -0
- package/assets/esri/themes/base/widgets/_ResponsiveToolbar.scss +9 -3
- package/assets/esri/themes/base/widgets/_Sketch.scss +32 -24
- 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/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ar.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bg.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bs.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ca.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_cs.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_da.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_de.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_el.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_es.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_et.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fi.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_he.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hu.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_id.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_it.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ja.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ko.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lt.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lv.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_nl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_no.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-BR.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-PT.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ro.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ru.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sk.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sv.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_th.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_tr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_uk.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_vi.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-CN.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-HK.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-TW.json +1 -1
- package/chunks/ColorMaterial.glsl.js +1 -1
- package/chunks/DefaultMaterial.glsl.js +1 -1
- package/chunks/ImageMaterial.glsl.js +3 -3
- package/chunks/LineMarker.glsl.js +11 -11
- package/chunks/NativeLine.glsl.js +1 -1
- package/chunks/Path.glsl.js +11 -11
- package/chunks/Pattern.glsl.js +2 -2
- package/chunks/RealisticTree.glsl.js +1 -1
- package/chunks/RibbonLine.glsl.js +1 -1
- package/chunks/Terrain.glsl.js +1 -1
- package/chunks/WaterSurface.glsl.js +9 -9
- package/copyright.txt +20 -0
- package/editing/sharedTemplates/SharedTemplate.js +1 -1
- package/editing/sharedTemplates/SharedTemplateMetadata.js +1 -1
- package/editing/sharedTemplates/SharedTemplateProvider.js +1 -1
- package/editing/sharedTemplates/executor/support/createServiceEdit.js +1 -1
- package/editing/sharedTemplates/support/sharedTemplateErrors.js +1 -1
- package/editing/sharedTemplates/templateDefinitions/FeatureTemplateDefinition.js +1 -1
- package/editing/sharedTemplates/templateDefinitions/GroupTemplateDefinition.js +1 -1
- package/editing/sharedTemplates/templateDefinitions/PresetTemplateDefinition.js +1 -1
- package/editing/sharedTemplates/templateDefinitions/TemplateDefinitionBase.js +1 -1
- package/editing/sharedTemplates/templateDefinitions/parts/FeatureTemplateRelationshipPart.js +1 -1
- package/editing/sharedTemplates/templateDefinitions/parts/GroupTemplatePart.js +1 -1
- package/editing/sharedTemplates/templateDefinitions/parts/TemplatePartBase.js +1 -1
- package/interfaces.d.ts +427 -93
- package/layers/ImageryLayer.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/RouteLayer.js +1 -1
- package/layers/WCSLayer.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/mixins/ImageryTileMixin.js +1 -1
- package/layers/mixins/RasterJobHandlerMixin.js +5 -0
- package/layers/orientedImagery/transformations/utils.js +1 -1
- package/layers/orientedImagery/transformations/worldToImage.js +1 -1
- package/layers/support/Relationship.js +1 -1
- package/layers/support/rasterFunctionUtils.d.ts +11 -0
- package/networks/UtilityNetwork.js +1 -1
- package/package.json +2 -2
- package/rest/route.js +1 -1
- package/rest/support/RouteParameters.js +1 -1
- package/rest/support/RouteSolveResult.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMEffects.js +1 -1
- package/symbols/cim/effects/EffectAddControlPoints.js +1 -1
- package/symbols/cim/effects/EffectBuffer.js +1 -1
- package/symbols/cim/effects/EffectDonut.js +1 -1
- package/symbols/cim/effects/EffectOffset.js +1 -1
- package/undoredo/support/Services.js +1 -1
- package/views/2d/AnimationManager.js +1 -1
- package/views/2d/engine/webgl/TextureManager.js +1 -1
- package/views/2d/engine/webgl/Utils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
- package/views/2d/layers/features/sources/FeatureSource.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
- package/views/2d/layers/imagery/VectorFieldTileView2D.js +1 -1
- package/views/2d/layers/imagery/VectorFieldView2D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
- package/views/3d/layers/graphics/pipeline/Tile.js +1 -1
- package/views/3d/layers/graphics/pipeline/Tile3DManager.js +1 -1
- package/views/3d/layers/graphics/pipeline/featureData/FeatureData.js +1 -1
- package/views/3d/layers/graphics/pipeline/featureData/FeatureDataSubset.js +5 -0
- package/views/3d/layers/graphics/pipeline/featureData/processingUtils.js +1 -1
- package/views/3d/layers/graphics/pipeline/featureSet/PBFPointFeatureSetView.js +1 -1
- package/views/3d/layers/graphics/pipeline/featureSet/TiledFeatureStore.js +1 -1
- package/views/3d/layers/graphics/pipeline/fetching/Tile3DFetcher.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/TestObjectSymbol.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/TestSymbol.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/UniqueValueFeatureRenderer.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentData.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticComponentBVH.js +1 -1
- package/views/3d/webgl-engine/collections/Component/IndexRange/ComponentRange.js +5 -0
- package/views/3d/webgl-engine/lib/ComponentUtils.js +1 -1
- package/views/View.js +1 -1
- package/views/animation/easing.js +1 -1
- package/views/webgl/ShaderBuilder.js +1 -1
- package/webmap/utils.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Directions/DirectionsViewModel.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/components/Prompt.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/ElevationProfile/components/LegendItem.js +1 -1
- package/widgets/ElevationProfile/components/SettingsButton.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/FeatureForm/UtilityNetworkAssociationAddAssociationViewModel.js +1 -1
- package/widgets/FeatureForm/featureFormUtils.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/Legend/styles/support/utils.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
- package/widgets/OrientedImageryViewer/symbols.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/OverflowGroup.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/ResponsiveToolbar.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/SplitButton.js +1 -1
- package/widgets/Sketch/support/sketchUtils.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/support/FilterCondition.js +1 -1
- package/widgets/support/GoTo.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/utilityNetworkUtils.js +1 -1
- package/widgets/support/goToUtils.js +1 -1
- package/assets/esri/core/workers/chunks/0c85731e9bf3eaeb96a2.js +0 -1
- package/assets/esri/core/workers/chunks/1b36d4400ab841c978c8.js +0 -1
- package/assets/esri/core/workers/chunks/3c44b4bf7fe407ec1d70.js +0 -1
- package/assets/esri/core/workers/chunks/4e3e141b3fd8bb652798.js +0 -1
- package/assets/esri/core/workers/chunks/544ad8fa4777ba8ec177.js +0 -1
- package/assets/esri/core/workers/chunks/717d7e9912d948e44d8d.js +0 -1
- package/assets/esri/core/workers/chunks/7bf9ebff90bb02bec8e7.js +0 -1
- package/assets/esri/core/workers/chunks/905cf2bb280479cd4f80.js +0 -1
- package/assets/esri/core/workers/chunks/b8fae500c69ca2cff62a.js +0 -1
- package/assets/esri/core/workers/chunks/b90b7ffc1e9363ed18e0.js +0 -1
- package/assets/esri/core/workers/chunks/bdc9dec6a359d2e3705c.js +0 -1
- package/assets/esri/core/workers/chunks/bf127fe767174e2715b5.js +0 -1
- package/assets/esri/core/workers/chunks/ccee343fb8c415b59ce3.js +0 -2
- package/assets/esri/core/workers/chunks/dc68246df91af766593a.js +0 -1
- package/assets/esri/core/workers/chunks/e862f1b9ecafc6c92b86.js +0 -314
- package/assets/esri/core/workers/chunks/f06231c14c0c0e5525bd.js +0 -1
- package/views/3d/layers/graphics/pipeline/featureData/FeatureDataStore.js +0 -5
- package/views/3d/webgl-engine/collections/Component/IndexRange/ComponentRangeRunLengthEncoded.js +0 -5
package/widgets/Sketch.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{isSome as t}from"../core/arrayUtils.js";import{handlesGroup as o}from"../core/handleUtils.js";import i from"../core/Logger.js";import{removeMaybe as s,destroyMaybe as l}from"../core/maybe.js";import{ignoreAbortErrors as r}from"../core/promiseUtils.js";import{watch as n,syncAndInitial as a,when as c}from"../core/reactiveUtils.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import u from"../views/interactive/sketch/SketchValueOptions.js";import h from"./Widget.js";import v from"./Sketch/SketchViewModel.js";import{VisibleElements as m}from"./Sketch/VisibleElements.js";import f from"./Sketch/support/ResponsiveToolbar/ResponsiveToolbar.js";import{loadCalciteComponents as g}from"./support/componentsUtils.js";import _ from"./support/SelectionToolbar.js";import y from"./support/SketchTooltipControls.js";import b from"./support/SnappingControls.js";import"./support/widgetUtils.js";import{messageBundle as w}from"./support/decorators/messageBundle.js";import{vmEvent as T}from"./support/decorators/vmEvent.js";import{tsx as M}from"./support/jsxFactory.js";import O from"./support/SketchTooltipControls/VisibleElements.js";import{substitute as C}from"../intl/substitute.js";const k="esri-sketch",S={base:k,vertical:`${k}--vertical`,docked:`${k}-bar`,chipHorizontal:`${k}__selection-count-chip--horizontal`,chipVertical:`${k}__selection-count-chip--vertical`,chipVerticalSmall:`${k}__selection-count-chip--vertical--s`,popoverWrapper:`${k}__popover-wrapper`},I={point:"pin",polyline:"line",polygon:"polygon",rectangle:"rectangle",circle:"circle",multipoint:"pins",mesh:"i3-d-building",freehandPolygon:"freehand-area",freehandPolyline:"freehand"};let P=class extends h{constructor(e,t){super(e,t),this._activeCustomToolOptions=null,this._selectionToolbar=null,this._viewModelHandlesGroup=null,this.availableCreateTools=["point","polyline","polygon","rectangle","circle"],this.customToolOptions=null,this.customActions=null,this.toolbarKind="floating",this.contextualToolLocation="separate",this.messages=null,this.messagesCommon=null,this.visibleElements=new m,this._defaultViewModel=null,this._calcitePopoverReferenceElement=null,this._relativeLocation="top",this._popoverOpen=!1,this._activateCreateTool=this._activateCreateTool.bind(this),this.viewModel=e?.viewModel||(this._defaultViewModel=new v({creationMode:e?.creationMode??"continuous"}))}initialize(){const{layer:e,view:t}=this,i=new _({view:"2d"===t?.type?t:null,sources:e?[e]:null,scale:this.scale});this.addHandles([n((()=>this.viewModel),(e=>{this._viewModelHandlesGroup=s(this._viewModelHandlesGroup),e&&(this._viewModelHandlesGroup=o([e.on("create",(()=>this.scheduleRender())),e.on("update",(()=>this.scheduleRender())),e.on("delete",(e=>this.emit("delete",e))),e.on("undo",(()=>this.scheduleRender())),e.on("redo",(()=>this.scheduleRender())),n((()=>e.layer),(e=>{this._selectionToolbar&&(this._selectionToolbar.sources=e?[e]:null)})),n((()=>e.view),(e=>{this._selectionToolbar&&(this._selectionToolbar.view="2d"===e?.type?e:null)})),n((()=>e.state),(()=>this.notifyChange("state")))]))}),a),c((()=>i.activeToolInfo),(()=>this.viewModel.cancel())),i.on("complete",(e=>this._onSelectionOperationComplete(e))),n((()=>{const{selectionTools:e}=this.visibleElements;return{lassoTool:!!e?.["lasso-selection"],rectangleTool:!!e?.["rectangle-selection"]}}),(e=>{Object.assign(i.visibleElements,e)}),a)]),this._selectionToolbar=i}loadDependencies(){return g({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover")})}destroy(){this._selectionToolbar?.destroy(),this._viewModelHandlesGroup=s(this._viewModelHandlesGroup)}get activeTool(){const e=this._selectionToolbar?.activeToolInfo;if(e)switch(e.toolName){case"lasso":return"lasso-selection";case"rectangle":return"rectangle-selection";case"default":return"custom-selection"}const t=this._effectiveAvailableCreateTools,{activeTool:o,activeCreateToolDrawMode:i}=this.viewModel;return"polygon"===o&&"freehand"===i&&t?.includes("freehandPolygon")?"freehandPolygon":"polyline"===o&&"freehand"===i&&t?.includes("freehandPolyline")?"freehandPolyline":this.viewModel.activeTool}get activeTooltip(){return this.viewModel.activeTooltip}get createGraphic(){return this.viewModel.createGraphic}get creationMode(){return this.viewModel.creationMode}set creationMode(e){this.viewModel.creationMode=e}get defaultCreateOptions(){return this.viewModel.defaultCreateOptions}set defaultCreateOptions(e){this.viewModel.defaultCreateOptions=e}get defaultUpdateOptions(){return this.viewModel.defaultUpdateOptions}set defaultUpdateOptions(e){this.viewModel.defaultUpdateOptions=e}get icon(){return"pencil"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get labelOptions(){return this.viewModel.labelOptions}set labelOptions(e){this.viewModel.labelOptions=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}set layout(e){this._set("layout",e),this._selectionToolbar&&(this._selectionToolbar.layout=e)}set scale(e){this._set("scale",e),this._selectionToolbar&&(this._selectionToolbar.scale=e)}get snappingOptions(){return this.viewModel.snappingOptions}set snappingOptions(e){this.viewModel.snappingOptions=e}get state(){return this._selectionToolbar?.activeToolInfo?"active":this.viewModel.state}get tooltipOptions(){return this.viewModel.tooltipOptions}set tooltipOptions(e){this.viewModel.tooltipOptions=e}get updateGraphics(){return this.viewModel.updateGraphics}get valueOptions(){return this.viewModel.valueOptions}set valueOptions(e){this.viewModel.valueOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}set viewModel(e){const t=this._get("viewModel");e!==t&&(t&&t===this._defaultViewModel&&l(t),this._set("viewModel",e))}get _effectiveAvailableCreateTools(){const{availableCreateTools:e,view:t,visibleElements:o}=this,i=e?.filter((e=>!!o.createTools?.[e]));return"3d"===t?.type?i?.filter((e=>"multipoint"!==e)):i}create(e,t,o){const i=o?.createOptions??t;return this._activeCustomToolOptions=o,r(this.viewModel.create(e,i))}update(e,t){return r(this.viewModel.update(e,t))}complete(){this.viewModel.complete()}cancel(){this._selectionToolbar?.cancel(),this.viewModel.cancel(),this._activeCustomToolOptions=null}undo(){this.viewModel.undo(),this.view?.focus()}redo(){this.viewModel.redo(),this.view?.focus()}delete(){this.viewModel.delete()}duplicate(){return this.viewModel.duplicate()}dismissFloatingElements(){this._popoverOpen=!1}render(){const{toolbarKind:e,layout:t,scale:o}=this,i=this.customActions?.filter((e=>"selection-toolbar"===e.position));return M("div",null,M("div",{classes:{[S.base]:!0,[S.docked]:"docked"===e,[S.vertical]:"vertical"===t}},M(f,{barStyle:e,layout:t,scale:o},this._renderSelectionSetItemGroupInline(),M("div",{"group-kind":"split-button",key:"selection-split-button",priority:0},this._renderDefaultSelectionButton(),this._selectionToolbar?.render(),i?.map((e=>this._renderToolbarItem(e)))),this._renderCreateToolActionGroup(),this._renderUndoRedoMenuItemGroup(),this._renderSettingsMenuItemGroup()),this._renderSelectionSetToolbar(),this._renderSettingsMenuPopover()))}_renderSettingsMenuPopover(){const{messagesCommon:e,snappingOptions:t,view:o,viewModel:i,visibleElements:s}=this;if(!this._calcitePopoverReferenceElement)return;const l={directionModePicker:s.directionModePicker,labelsToggle:s.labelsToggle,tooltipsToggle:s.tooltipsToggle},r="horizontal"===this.layout?"top"===this._relativeLocation?"bottom-end":"top-end":"right-end";return M("calcite-popover",{closable:!0,focusTrapDisabled:!0,heading:e.settings,label:e.settings,open:this._popoverOpen,overlayPositioning:"fixed",placement:r,referenceElement:this._calcitePopoverReferenceElement,scale:this.scale,onCalcitePopoverBeforeClose:()=>this._popoverOpen=!1,onCalcitePopoverBeforeOpen:e=>this._remeasurePopoverSizes(e.currentTarget),onCalcitePopoverClose:()=>this._refocusOnView()},M("div",{class:S.popoverWrapper},Object.values(l).includes(!0)?M(y,{sketchOptions:i.sketchOptions,viewType:o?.type,visibleElements:new O(l)}):void 0,s.snappingControls&&o&&t?M(b,{snappingManager:this.viewModel.snappingManager,snappingOptions:t,view:o,visibleElements:s.snappingControlsElements}):void 0))}_renderSelectionSetToolbar(){if("separate"!==this.contextualToolLocation)return;const e=this._renderSelectionSetItemGroup();return e?.length?M(f,{barStyle:this.toolbarKind,layout:this.layout,scale:this.scale},e):void 0}_renderSelectionSetItemGroupInline(){return"separate"===this.contextualToolLocation?[]:this._renderSelectionSetItemGroup()}_renderUndoRedoMenuItemGroup(){return M("div",{"group-kind":"split-button",key:"undo-redo-menu",priority:10,slot:"actions-end"},this._renderUndoButton(),this._renderRedoButton())}_renderSettingsMenuItemGroup(){const e=this.customActions?.filter((e=>"settings-before"===e.position));return this._renderToolbarItemGroup({key:"settings-menu",elements:[e?.map((e=>this._renderToolbarItem(e))),this._renderSettingsMenuButton()],slot:"actions-end"})}_renderSelectionSetItemGroup(){if(!this.updateGraphics.length)return[];const e="inline-end"===this.contextualToolLocation?"actions-end":void 0,t=this.customActions?.filter((e=>"before-selection-set"===e.position)),o=this.customActions?.filter((e=>"after-selection-set"===e.position));return[M("div",{"group-kind":"measured-content",key:"selection-count-chip-group",priority:100,slot:e},this._renderFeatureCountChip()),M("div",{"allow-collapse":!1,"group-kind":"overflow-group",key:"selection-set-tool-group",priority:100,slot:e},t?.map((e=>this._renderToolbarItem(e))),this._renderDuplicateButton(),this._renderDeleteButton(),o?.map((e=>this._renderToolbarItem(e))))]}_renderDefaultSelectionButton(){if(!this.viewModel.updateOnGraphicClick)return[];const{messages:e,state:t}=this;return this._renderToolbarItem({id:"pointer-select",text:e.selectFeature,icon:"cursor",onclick:this._activateDefaultSelectTool,active:"ready"===t})}_renderCreateToolActionGroup(){const e=this._effectiveAvailableCreateTools?.flatMap((e=>this._renderBuiltInCreateToolItem(e)))??[],t=this.customToolOptions?.flatMap((e=>this._renderCustomToolItem(e)))??[];return M("div",{"group-kind":"overflow-group",key:"create-tools-group",priority:100},e,t)}_renderBuiltInCreateToolItem(e){return this._renderToolbarItem({id:`${e}-button`,text:this.messages.draw[e],icon:I[e],onclick:()=>this._activateCreateTool(e),active:this.activeTool===e&&!this._activeCustomToolOptions})}_renderCustomToolItem(e){const{toolKey:t}=e;return this._renderToolbarItem({id:`custom-${e.toolKey}`,text:e.label,icon:e.icon,onclick:()=>this._activateCreateTool(e.toolName,null,e),active:this._activeCustomToolOptions?.toolKey===t})}_renderUndoButton(){return this.visibleElements.undoRedoMenu?this._renderToolbarItem({id:"undo-button",text:this.messages.undo,icon:"undo",disabled:!this.viewModel.canUndo(),onclick:this.undo,flipRTL:!0}):[]}_renderRedoButton(){return this.visibleElements.undoRedoMenu?this._renderToolbarItem({id:"redo-button",text:this.messages.redo,icon:"redo",disabled:!this.viewModel.canRedo(),onclick:this.redo,flipRTL:!0}):[]}_renderSettingsMenuButton(){return this.visibleElements.settingsMenu?this._renderToolbarItem({id:"settings-menu-action",text:this.messagesCommon.settings,icon:"gear",active:this._popoverOpen,onclick:()=>this._popoverOpen=!this._popoverOpen,afterCreate:e=>this._calcitePopoverReferenceElement=e,afterUpdate:e=>this._calcitePopoverReferenceElement=e,afterRemoved:()=>this._calcitePopoverReferenceElement=null}):[]}_renderFeatureCountChip(){if(!this.visibleElements.selectionCountLabel)return[];const{layout:e,messages:t,scale:o,id:i,updateGraphics:{length:s}}=this,l=C(t.selectedCount,{count:s}),r="s"===o?99:999,n=s>r?C(t.selectedCountTruncated,{truncated:r}):s,a="s"===o&&"vertical"===e,c=a?`${i}-selection-chip-small`:`${i}-selection-chip`;return[a?M("span",{classes:{[S.chipVertical]:!0,[S.chipVerticalSmall]:"s"===this.scale},id:c,tabIndex:0,title:l},n):M("calcite-chip",{appearance:"outline",class:"horizontal"===e?S.chipHorizontal:S.chipVertical,id:c,kind:"brand",label:l,scale:"l"===o?"m":"s",tabIndex:0,title:"vertical"===e?l:void 0},"vertical"===e?n:l)]}_renderDuplicateButton(){if(!this.visibleElements.duplicateButton)return[];const{messages:e}=this;return this._renderToolbarItem({id:"duplicate",text:this.updateGraphics.length>1?e.duplicateFeatures:e.duplicateFeature,icon:"copy",onclick:this._onDuplicateSelect})}_renderDeleteButton(){if(!this.visibleElements.deleteButton)return[];const{messages:e}=this,t=this.updateGraphics.length>1?e.deleteFeatures:e.deleteFeature;return this._renderToolbarItem({id:"delete",text:t,icon:"trash",onclick:this.delete})}_renderToolbarItemGroup({key:e,elements:o,slot:i}){const s=o?.filter(t);if(s?.length)return M("div",{"allow-collapse":!1,"group-kind":"overflow-group",key:e,priority:1e3,slot:i},s)}_renderToolbarItem({id:e,text:t,icon:o,disabled:i,onclick:s,active:l,flipRTL:r,afterCreate:n,afterUpdate:a,afterRemoved:c}){const p=`${this.id}-${e}`;return[M("calcite-action",{active:l,afterCreate:n,afterRemoved:c,afterUpdate:a,bind:this,"data-testid":e,disabled:i||"disabled"===this.state,icon:o,iconFlipRtl:r??!1,id:p,key:e,onclick:s,scale:this.scale,text:t,title:t})]}_remeasurePopoverSizes(e){try{const t=e.parentElement,o=this?.view?.container?.getBoundingClientRect(),i=t?.style;if(!(t&&o&&i&&this.view?.container?.contains(t)))return;const s=this._calcitePopoverReferenceElement;if(!s)return;const{bottom:l,top:r}=s.getBoundingClientRect();if("horizontal"===this.layout){const e=l<o.height/2;e!==("top"===this._relativeLocation)&&(this._relativeLocation=e?"top":"bottom"),e?(i?.setProperty("--sketch-view-height-offset",l-o.top+"px"),i?.setProperty("--sketch-view-margin-offset","30px")):(i?.setProperty("--sketch-view-height-offset",o.bottom-r+"px"),i?.setProperty("--sketch-view-margin-offset","15px"))}else"vertical"===this.layout&&(i.setProperty("--sketch-view-height-offset","15px"),i.setProperty("--sketch-view-margin-offset","15px"));const n=e.shadowRoot?.querySelector("div.header")?.getBoundingClientRect().height;i.setProperty("--sketch-popover-header-offset",`${n}px`)}catch(t){i.getLogger(this.declaredClass).warnOnce("Sketch failed to lay out settings menu.",t)}}_activateCreateTool(e,t,o){const i=this._activeCustomToolOptions;if(o||i){if(o?.toolKey===i?.toolKey)return void this.cancel()}else if(this.activeTool===e)return void this.cancel();this._selectionToolbar?.cancel(),this.create(e,t,o)}_onDuplicateSelect(){const e=this.duplicate(),t=this.viewModel.activeTool;"transform"!==t&&"reshape"!==t||this.update(e,{tool:t})}_onSelectionOperationComplete(e){const{viewModel:{defaultUpdateOptions:t}}=this,{selection:o}=e;if(!e.aborted&&o.length){const e=t.tool,i=o.length>1&&"reshape"===e?"transform":e;this.update(o,{...t,tool:i})}this.notifyChange("state")}_activateDefaultSelectTool(){this.cancel(),this.view?.focus()}_refocusOnView(){this.activeTool&&this.view?.focus()}};e([p()],P.prototype,"_activeCustomToolOptions",void 0),e([p()],P.prototype,"activeTool",null),e([p({readOnly:!0})],P.prototype,"activeTooltip",null),e([p({cast:e=>{if(!e?.length)return null;const t=new Set(["point","polyline","polygon","rectangle","circle","multipoint","freehandPolyline","freehandPolygon","mesh"]);return e.filter((e=>t.has(e)))}})],P.prototype,"availableCreateTools",void 0),e([p({readOnly:!0})],P.prototype,"createGraphic",null),e([p()],P.prototype,"creationMode",null),e([p()],P.prototype,"customToolOptions",void 0),e([p()],P.prototype,"customActions",void 0),e([p()],P.prototype,"defaultCreateOptions",null),e([p()],P.prototype,"defaultUpdateOptions",null),e([p()],P.prototype,"icon",null),e([p()],P.prototype,"label",null),e([p()],P.prototype,"labelOptions",null),e([p()],P.prototype,"layer",null),e([p({type:["horizontal","vertical"],value:"horizontal"})],P.prototype,"layout",null),e([p({value:"m"})],P.prototype,"scale",null),e([p()],P.prototype,"toolbarKind",void 0),e([p()],P.prototype,"contextualToolLocation",void 0),e([p(),w("esri/widgets/Sketch/t9n/Sketch")],P.prototype,"messages",void 0),e([p(),w("esri/t9n/common")],P.prototype,"messagesCommon",void 0),e([p()],P.prototype,"snappingOptions",null),e([p()],P.prototype,"state",null),e([p()],P.prototype,"tooltipOptions",null),e([p({readOnly:!0})],P.prototype,"updateGraphics",null),e([p({type:u,nonNullable:!0})],P.prototype,"valueOptions",null),e([p()],P.prototype,"view",null),e([p({type:v}),T(["create","update","undo","redo"])],P.prototype,"viewModel",null),e([p({type:m,nonNullable:!0})],P.prototype,"visibleElements",void 0),e([p()],P.prototype,"_effectiveAvailableCreateTools",null),e([p()],P.prototype,"_defaultViewModel",void 0),e([p()],P.prototype,"_calcitePopoverReferenceElement",void 0),e([p()],P.prototype,"_relativeLocation",void 0),e([p()],P.prototype,"_popoverOpen",void 0),P=e([d("esri.widgets.Sketch")],P);const R=P;export{R as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{isSome as t}from"../core/arrayUtils.js";import{handlesGroup as o}from"../core/handleUtils.js";import i from"../core/Logger.js";import{removeMaybe as s,destroyMaybe as l}from"../core/maybe.js";import{ignoreAbortErrors as r}from"../core/promiseUtils.js";import{watch as n,syncAndInitial as a,when as c}from"../core/reactiveUtils.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import u from"../views/interactive/sketch/SketchValueOptions.js";import h from"./Widget.js";import v from"./Sketch/SketchViewModel.js";import{VisibleElements as m}from"./Sketch/VisibleElements.js";import{LayoutPriority as g}from"./Sketch/support/sketchUtils.js";import f from"./Sketch/support/ResponsiveToolbar/ResponsiveToolbar.js";import{loadCalciteComponents as _}from"./support/componentsUtils.js";import y from"./support/SelectionToolbar.js";import b from"./support/SketchTooltipControls.js";import w from"./support/SnappingControls.js";import"./support/widgetUtils.js";import{messageBundle as T}from"./support/decorators/messageBundle.js";import{vmEvent as M}from"./support/decorators/vmEvent.js";import{tsx as C}from"./support/jsxFactory.js";import O from"./support/SketchTooltipControls/VisibleElements.js";import{substitute as k}from"../intl/substitute.js";const S="esri-sketch",P={base:S,vertical:`${S}--vertical`,docked:`${S}-bar`,floating:`${S}-pad`,chipHorizontal:`${S}__selection-count-chip--horizontal`,chipVertical:`${S}__selection-count-chip--vertical`,chipVerticalSmall:`${S}__selection-count-chip--vertical--s`,popoverWrapper:`${S}__popover-wrapper`},I={point:"pin",polyline:"line",polygon:"polygon",rectangle:"rectangle",circle:"circle",multipoint:"pins",mesh:"i3-d-building",freehandPolygon:"freehand-area",freehandPolyline:"freehand"};let R=class extends h{constructor(e,t){super(e,t),this._activeCustomToolOptions=null,this._selectionToolbar=null,this._viewModelHandlesGroup=null,this.availableCreateTools=["point","polyline","polygon","rectangle","circle"],this.customToolOptions=null,this.customActions=null,this.toolbarKind="floating",this.contextualToolLocation="separate",this.groupCollapsePriorities=null,this.messages=null,this.messagesCommon=null,this.visibleElements=new m,this._defaultViewModel=null,this._calcitePopoverReferenceElement=null,this._relativeLocation="top",this._popoverOpen=!1,this._activateCreateTool=this._activateCreateTool.bind(this),this.viewModel=e?.viewModel||(this._defaultViewModel=new v({creationMode:e?.creationMode??"continuous"}))}initialize(){const{layer:e,view:t}=this,i=new y({view:"2d"===t?.type?t:null,sources:e?[e]:null,scale:this.scale});this.addHandles([n((()=>this.viewModel),(e=>{this._viewModelHandlesGroup=s(this._viewModelHandlesGroup),e&&(this._viewModelHandlesGroup=o([e.on("create",(()=>this.scheduleRender())),e.on("update",(()=>this.scheduleRender())),e.on("delete",(e=>this.emit("delete",e))),e.on("undo",(()=>this.scheduleRender())),e.on("redo",(()=>this.scheduleRender())),n((()=>e.layer),(e=>{this._selectionToolbar&&(this._selectionToolbar.sources=e?[e]:null)})),n((()=>e.view),(e=>{this._selectionToolbar&&(this._selectionToolbar.view="2d"===e?.type?e:null)})),n((()=>e.state),(()=>this.notifyChange("state")))]))}),a),c((()=>i.activeToolInfo),(()=>this.viewModel.cancel())),i.on("complete",(e=>this._onSelectionOperationComplete(e))),n((()=>{const{selectionTools:e}=this.visibleElements;return{lassoTool:!!e?.["lasso-selection"],rectangleTool:!!e?.["rectangle-selection"]}}),(e=>{Object.assign(i.visibleElements,e)}),a)]),this._selectionToolbar=i}loadDependencies(){return _({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover")})}destroy(){this._selectionToolbar?.destroy(),this._viewModelHandlesGroup=s(this._viewModelHandlesGroup)}get activeTool(){const e=this._selectionToolbar?.activeToolInfo;if(e)switch(e.toolName){case"lasso":return"lasso-selection";case"rectangle":return"rectangle-selection";case"default":return"custom-selection"}const t=this._effectiveAvailableCreateTools,{activeTool:o,activeCreateToolDrawMode:i}=this.viewModel;return"polygon"===o&&"freehand"===i&&t?.includes("freehandPolygon")?"freehandPolygon":"polyline"===o&&"freehand"===i&&t?.includes("freehandPolyline")?"freehandPolyline":this.viewModel.activeTool}get activeTooltip(){return this.viewModel.activeTooltip}get createGraphic(){return this.viewModel.createGraphic}get creationMode(){return this.viewModel.creationMode}set creationMode(e){this.viewModel.creationMode=e}get defaultCreateOptions(){return this.viewModel.defaultCreateOptions}set defaultCreateOptions(e){this.viewModel.defaultCreateOptions=e}get defaultUpdateOptions(){return this.viewModel.defaultUpdateOptions}set defaultUpdateOptions(e){this.viewModel.defaultUpdateOptions=e}get icon(){return"pencil"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get labelOptions(){return this.viewModel.labelOptions}set labelOptions(e){this.viewModel.labelOptions=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}set layout(e){this._set("layout",e),this._selectionToolbar&&(this._selectionToolbar.layout=e)}set scale(e){this._set("scale",e),this._selectionToolbar&&(this._selectionToolbar.scale=e)}get snappingOptions(){return this.viewModel.snappingOptions}set snappingOptions(e){this.viewModel.snappingOptions=e}get state(){return this._selectionToolbar?.activeToolInfo?"active":this.viewModel.state}get tooltipOptions(){return this.viewModel.tooltipOptions}set tooltipOptions(e){this.viewModel.tooltipOptions=e}get updateGraphics(){return this.viewModel.updateGraphics}get valueOptions(){return this.viewModel.valueOptions}set valueOptions(e){this.viewModel.valueOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}set viewModel(e){const t=this._get("viewModel");e!==t&&(t&&t===this._defaultViewModel&&l(t),this._set("viewModel",e))}get _effectiveAvailableCreateTools(){const{availableCreateTools:e,view:t,visibleElements:o}=this,i=e?.filter((e=>!!o.createTools?.[e]));return"3d"===t?.type?i?.filter((e=>"multipoint"!==e)):i}create(e,t,o){const i=o?.createOptions??t;return this._activeCustomToolOptions=o,r(this.viewModel.create(e,i))}update(e,t){return r(this.viewModel.update(e,t))}complete(){this.viewModel.complete()}cancel(){this._selectionToolbar?.cancel(),this.viewModel.cancel(),this._activeCustomToolOptions=null}undo(){this.viewModel.undo(),this.view?.focus()}redo(){this.viewModel.redo(),this.view?.focus()}delete(){this.viewModel.delete()}duplicate(){return this.viewModel.duplicate()}dismissFloatingElements(){this._popoverOpen=!1}render(){const{toolbarKind:e,layout:t,scale:o}=this,i=this.customActions?.filter((e=>"selection-toolbar"===e.position));return C("div",null,C("div",{classes:{[P.base]:!0,[P.floating]:"floating"===e,[P.docked]:"docked"===e,[P.vertical]:"vertical"===t}},C(f,{barStyle:e,layout:t,scale:o},this._renderSelectionSetItemGroupInline(),C("div",{"group-kind":"split-button",key:"selection-split-button",priority:this.groupCollapsePriorities?.get("selectionTools")??g.Low},this._renderDefaultSelectionButton(),this._selectionToolbar?.render(),i?.map((e=>this._renderToolbarItem(e)))),this._renderCreateToolActionGroup(),this._renderUndoRedoMenuItemGroup(),this._renderSettingsMenuItemGroup()),this._renderSelectionSetToolbar(),this._renderSettingsMenuPopover()))}_renderSettingsMenuPopover(){const{messagesCommon:e,snappingOptions:t,view:o,viewModel:i,visibleElements:s}=this;if(!this._calcitePopoverReferenceElement)return;const l={directionModePicker:s.directionModePicker,labelsToggle:s.labelsToggle,tooltipsToggle:s.tooltipsToggle},r="horizontal"===this.layout?"top"===this._relativeLocation?"bottom-end":"top-end":"right-end";return C("calcite-popover",{closable:!0,focusTrapDisabled:!0,heading:e.settings,label:e.settings,open:this._popoverOpen,overlayPositioning:"fixed",placement:r,referenceElement:this._calcitePopoverReferenceElement,scale:this.scale,onCalcitePopoverBeforeClose:()=>this._popoverOpen=!1,onCalcitePopoverBeforeOpen:e=>this._remeasurePopoverSizes(e.currentTarget),onCalcitePopoverClose:()=>this._refocusOnView()},C("div",{class:P.popoverWrapper},Object.values(l).includes(!0)?C(b,{sketchOptions:i.sketchOptions,viewType:o?.type,visibleElements:new O(l)}):void 0,s.snappingControls&&o&&t?C(w,{snappingManager:this.viewModel.snappingManager,snappingOptions:t,view:o,visibleElements:s.snappingControlsElements}):void 0))}_renderSelectionSetToolbar(){if("separate"!==this.contextualToolLocation)return;const e=this._renderSelectionSetItemGroup();return e?.length?C(f,{barStyle:this.toolbarKind,layout:this.layout,scale:this.scale},e):void 0}_renderSelectionSetItemGroupInline(){return"separate"===this.contextualToolLocation?[]:this._renderSelectionSetItemGroup()}_renderUndoRedoMenuItemGroup(){return C("div",{"group-kind":"split-button",key:"undo-redo-menu",priority:this.groupCollapsePriorities?.get("undoRedo")??g.Medium,slot:"actions-end"},this._renderUndoButton(),this._renderRedoButton())}_renderSettingsMenuItemGroup(){const e=[],o=[];this.customActions?.forEach((t=>{"settings-before"===t.position?o.push(t):"settings-after"===t.position&&e.push(t)}));const i=[...o.map((e=>this._renderToolbarItem(e))),this._renderSettingsMenuButton(),...e.map((e=>this._renderToolbarItem(e)))].filter(t);if(i.length)return C("div",{"allow-collapse":!1,"group-kind":"overflow-group",key:"settings-menu",priority:this.groupCollapsePriorities?.get("settings")??g.Max,slot:"actions-end"},i)}_renderSelectionSetItemGroup(){if(!this.updateGraphics.length)return[];const e="inline-end"===this.contextualToolLocation?"actions-end":void 0,t=this.customActions?.filter((e=>"before-selection-set"===e.position)),o=this.customActions?.filter((e=>"after-selection-set"===e.position)),i=this.groupCollapsePriorities?.get("selectionSet")??g.High;return[C("div",{"group-kind":"measured-content",key:"selection-count-chip-group",priority:i,slot:e},this._renderFeatureCountChip()),C("div",{"allow-collapse":!1,"group-kind":"overflow-group",key:"selection-set-tool-group",priority:i,slot:e},t?.map((e=>this._renderToolbarItem(e))),this._renderDuplicateButton(),this._renderDeleteButton(),o?.map((e=>this._renderToolbarItem(e))))]}_renderDefaultSelectionButton(){if(!this.viewModel.updateOnGraphicClick)return[];const{messages:e,state:t}=this;return this._renderToolbarItem({id:"pointer-select",text:e.selectFeature,icon:"cursor",onclick:this._activateDefaultSelectTool,active:"ready"===t})}_renderCreateToolActionGroup(){const e=this._effectiveAvailableCreateTools?.flatMap((e=>this._renderBuiltInCreateToolItem(e)))??[],t=this.customToolOptions?.flatMap((e=>this._renderCustomToolItem(e)))??[];return C("div",{"group-kind":"overflow-group",key:"create-tools-group",priority:this.groupCollapsePriorities?.get("createTools")??g.High},e,t)}_renderBuiltInCreateToolItem(e){return this._renderToolbarItem({id:`${e}-button`,text:this.messages.draw[e],icon:I[e],onclick:()=>this._activateCreateTool(e),active:this.activeTool===e&&!this._activeCustomToolOptions})}_renderCustomToolItem(e){const{toolKey:t}=e;return this._renderToolbarItem({id:`custom-${e.toolKey}`,text:e.label,icon:e.icon,onclick:()=>this._activateCreateTool(e.toolName,null,e),active:this._activeCustomToolOptions?.toolKey===t})}_renderUndoButton(){return this.visibleElements.undoRedoMenu?this._renderToolbarItem({id:"undo-button",text:this.messages.undo,icon:"undo",disabled:!this.viewModel.canUndo(),onclick:this.undo,flipRTL:!0}):[]}_renderRedoButton(){return this.visibleElements.undoRedoMenu?this._renderToolbarItem({id:"redo-button",text:this.messages.redo,icon:"redo",disabled:!this.viewModel.canRedo(),onclick:this.redo,flipRTL:!0}):[]}_renderSettingsMenuButton(){return this.visibleElements.settingsMenu?this._renderToolbarItem({id:"settings-menu-action",text:this.messagesCommon.settings,icon:"gear",active:this._popoverOpen,onclick:()=>this._popoverOpen=!this._popoverOpen,afterCreate:e=>this._calcitePopoverReferenceElement=e,afterUpdate:e=>this._calcitePopoverReferenceElement=e,afterRemoved:()=>this._calcitePopoverReferenceElement=null}):[]}_renderFeatureCountChip(){if(!this.visibleElements.selectionCountLabel)return[];const{layout:e,messages:t,scale:o,id:i,updateGraphics:{length:s}}=this,l=k(t.selectedCount,{count:s}),r="s"===o?99:999,n=s>r?k(t.selectedCountTruncated,{truncated:r}):s,a="s"===o&&"vertical"===e,c=a?`${i}-selection-chip-small`:`${i}-selection-chip`;return[a?C("span",{classes:{[P.chipVertical]:!0,[P.chipVerticalSmall]:"s"===this.scale},id:c,tabIndex:0,title:l},n):C("calcite-chip",{appearance:"outline",class:"horizontal"===e?P.chipHorizontal:P.chipVertical,id:c,kind:"brand",label:l,scale:"l"===o?"m":"s",tabIndex:0,title:"vertical"===e?l:void 0},"vertical"===e?n:l)]}_renderDuplicateButton(){if(!this.visibleElements.duplicateButton)return[];const{messages:e}=this;return this._renderToolbarItem({id:"duplicate",text:this.updateGraphics.length>1?e.duplicateFeatures:e.duplicateFeature,icon:"copy",onclick:this._onDuplicateSelect})}_renderDeleteButton(){if(!this.visibleElements.deleteButton)return[];const{messages:e}=this,t=this.updateGraphics.length>1?e.deleteFeatures:e.deleteFeature;return this._renderToolbarItem({id:"delete",text:t,icon:"trash",onclick:this.delete})}_renderToolbarItem({id:e,text:t,icon:o,disabled:i,onclick:s,active:l,flipRTL:r,afterCreate:n,afterUpdate:a,afterRemoved:c}){const p=`${this.id}-${e}`;return[C("calcite-action",{active:l,afterCreate:n,afterRemoved:c,afterUpdate:a,bind:this,"data-testid":e,disabled:i||"disabled"===this.state,icon:o,iconFlipRtl:r??!1,id:p,key:e,onclick:s,scale:this.scale,text:t,title:t})]}_remeasurePopoverSizes(e){try{const t=e.parentElement,o=this?.view?.container?.getBoundingClientRect(),i=t?.style;if(!(t&&o&&i&&this.view?.container?.contains(t)))return;const s=this._calcitePopoverReferenceElement;if(!s)return;const{bottom:l,top:r}=s.getBoundingClientRect();if("horizontal"===this.layout){const e=l<o.height/2;e!==("top"===this._relativeLocation)&&(this._relativeLocation=e?"top":"bottom"),e?(i?.setProperty("--sketch-view-height-offset",l-o.top+"px"),i?.setProperty("--sketch-view-margin-offset","30px")):(i?.setProperty("--sketch-view-height-offset",o.bottom-r+"px"),i?.setProperty("--sketch-view-margin-offset","15px"))}else"vertical"===this.layout&&(i.setProperty("--sketch-view-height-offset","15px"),i.setProperty("--sketch-view-margin-offset","15px"));const n=e.shadowRoot?.querySelector("div.header")?.getBoundingClientRect().height;i.setProperty("--sketch-popover-header-offset",`${n}px`)}catch(t){i.getLogger(this.declaredClass).warnOnce("Sketch failed to lay out settings menu.",t)}}_activateCreateTool(e,t,o){const i=this._activeCustomToolOptions;if(o||i){if(o?.toolKey===i?.toolKey)return void this.cancel()}else if(this.activeTool===e)return void this.cancel();this._selectionToolbar?.cancel(),this.create(e,t,o)}_onDuplicateSelect(){const e=this.duplicate(),t=this.viewModel.activeTool;"transform"!==t&&"reshape"!==t||this.update(e,{tool:t})}_onSelectionOperationComplete(e){const{viewModel:{defaultUpdateOptions:t}}=this,{selection:o}=e;if(!e.aborted&&o.length){const e=t.tool,i=o.length>1&&"reshape"===e?"transform":e;this.update(o,{...t,tool:i})}this.notifyChange("state")}_activateDefaultSelectTool(){this.cancel(),this.view?.focus()}_refocusOnView(){this.activeTool&&this.view?.focus()}};e([p()],R.prototype,"_activeCustomToolOptions",void 0),e([p()],R.prototype,"activeTool",null),e([p({readOnly:!0})],R.prototype,"activeTooltip",null),e([p({cast:e=>{if(!e?.length)return null;const t=new Set(["point","polyline","polygon","rectangle","circle","multipoint","freehandPolyline","freehandPolygon","mesh"]);return e.filter((e=>t.has(e)))}})],R.prototype,"availableCreateTools",void 0),e([p({readOnly:!0})],R.prototype,"createGraphic",null),e([p()],R.prototype,"creationMode",null),e([p()],R.prototype,"customToolOptions",void 0),e([p()],R.prototype,"customActions",void 0),e([p()],R.prototype,"defaultCreateOptions",null),e([p()],R.prototype,"defaultUpdateOptions",null),e([p()],R.prototype,"icon",null),e([p()],R.prototype,"label",null),e([p()],R.prototype,"labelOptions",null),e([p()],R.prototype,"layer",null),e([p({type:["horizontal","vertical"],value:"horizontal"})],R.prototype,"layout",null),e([p({value:"m"})],R.prototype,"scale",null),e([p()],R.prototype,"toolbarKind",void 0),e([p()],R.prototype,"contextualToolLocation",void 0),e([p()],R.prototype,"groupCollapsePriorities",void 0),e([p(),T("esri/widgets/Sketch/t9n/Sketch")],R.prototype,"messages",void 0),e([p(),T("esri/t9n/common")],R.prototype,"messagesCommon",void 0),e([p()],R.prototype,"snappingOptions",null),e([p()],R.prototype,"state",null),e([p()],R.prototype,"tooltipOptions",null),e([p({readOnly:!0})],R.prototype,"updateGraphics",null),e([p({type:u,nonNullable:!0})],R.prototype,"valueOptions",null),e([p()],R.prototype,"view",null),e([p({type:v}),M(["create","update","undo","redo"])],R.prototype,"viewModel",null),e([p({type:m,nonNullable:!0})],R.prototype,"visibleElements",void 0),e([p()],R.prototype,"_effectiveAvailableCreateTools",null),e([p()],R.prototype,"_defaultViewModel",void 0),e([p()],R.prototype,"_calcitePopoverReferenceElement",void 0),e([p()],R.prototype,"_relativeLocation",void 0),e([p()],R.prototype,"_popoverOpen",void 0),R=e([d("esri.widgets.Sketch")],R);const j=R;export{j as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import{cast as i}from"../../core/accessorSupport/decorators/cast.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import{cast as i}from"../../core/accessorSupport/decorators/cast.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import l from"../Widget.js";import{loadCalciteComponents as o}from"./componentsUtils.js";import"./widgetUtils.js";import{messageBundle as s}from"./decorators/messageBundle.js";import{tsx as a}from"./jsxFactory.js";import n from"./FilterCondition/FilterConditionViewModel.js";const d={},p="esri-filter-condition",u={base:p,container:`${p}__container`,valueInputContainer:`${p}__value-input-container`};let c=class extends l{constructor(e,t){super(e,t),this.messages=null,this.messagesCommon=null,this.viewModel=new n,this.visibleElements={...d}}loadDependencies(){return o({input:()=>import("@esri/calcite-components/dist/components/calcite-input"),option:()=>import("@esri/calcite-components/dist/components/calcite-option"),select:()=>import("@esri/calcite-components/dist/components/calcite-select")})}get _defaultFieldName(){const{fields:e,fieldName:t}=this;return t||(e?.length?e[0].name:void 0)}get _valueInputType(){const{viewModel:e}=this;return e.isNumericField||e.isObjectIDField?"number":"text"}get _visibleOperators(){const{field:e,operators:t,viewModel:i}=this;return e?i.isStringField||i.isGlobalIDField?t.string:i.isNumericField?t.number:i.isObjectIDField?t.id:[]:[]}get _isValueInputHidden(){const{operator:e}=this;return!!e&&["isBlank","isNotBlank","isEmpty","isNotEmpty"].includes(e)}get domain(){return this.viewModel.domain}get field(){return this.viewModel.field}get fields(){return this.viewModel.fields}get fieldLabel(){return this.viewModel.fieldLabel}get fieldName(){return this.viewModel.fieldName}set fieldName(e){this.viewModel.fieldName=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get normalizedFieldName(){return this.viewModel.normalizedFieldName}get operator(){return this.viewModel.operator}set operator(e){this.viewModel.operator=e}get operators(){return this.viewModel.operators}set operators(e){this.viewModel.operators=e}get state(){return this.viewModel.state}get value(){return this.viewModel.value}set value(e){this.viewModel.value=e}get valueAsString(){return this.viewModel.valueAsString}castVisibleElements(e){return{...d,...e}}get whereClause(){return this.viewModel.whereClause}render(){return a("div",{class:u.base},this._renderFieldSelection(),this._renderOperatorSelection(),this._renderValueInput())}_renderFieldSelection(){const e=this.normalizedFieldName;return a("div",null,a("calcite-select",{afterCreate:()=>{this.fieldName||(this.fieldName=this._defaultFieldName)},bind:this,label:this.messages.chooseField,width:"full",onCalciteSelectChange:({currentTarget:e})=>{this.value=null,this.fieldName=e.value}},this.fields.map((t=>this._renderOption(t.name,t.alias,e)))))}_renderOperatorSelection(){const{_visibleOperators:e,messages:t,operator:i}=this;if(e.length)return a("div",null,a("calcite-select",{afterUpdate:e=>{const t=e.value;this._visibleOperators.includes(t)||(this.operator=this._visibleOperators[0])},bind:this,label:t.operator,required:!0,width:"full",onCalciteSelectChange:e=>{this.operator=e.currentTarget.value}},e.map((e=>this._renderOption(e,t.operators[e],i)))))}_renderOption(e,t,i){return a("calcite-option",{key:e,label:t??e,selected:e===i,value:e})}_renderValueInput(){const{valueAsString:e,domain:t,messages:i,operator:r}=this;if(!this._isValueInputHidden){if("coded-value"===t?.type&&t.codedValues.length&&("is"===r||"isNot"===r)){const r=t.codedValues[0].code;return a("div",{key:"value-select"},a("calcite-select",{afterCreate:()=>this._afterSelectCreateOrUpdate(r),afterUpdate:()=>this._afterSelectCreateOrUpdate(r),bind:this,label:i.value,required:!0,width:"full",onCalciteSelectChange:({currentTarget:e})=>{this._onValueChange(e.value)}},t.codedValues.map((({code:t,name:i})=>this._renderOption(`${t}`,i,e)))))}return a("div",{class:u.valueInputContainer,key:"value-input"},a("calcite-input",{label:i.value,type:this._valueInputType,value:e,onCalciteInputInput:({currentTarget:e})=>{this._onValueChange(e.value)}}))}}_afterSelectCreateOrUpdate(e){null==this.value&&(this.value=e)}_onValueChange(e){const{viewModel:t}=this;e&&""!==e?t.isStringField||t.isGlobalIDField?this.value=e.toString():(t.isNumericField||t.isObjectIDField)&&(this.value=parseFloat(e)):this.value=null}};e([t()],c.prototype,"_defaultFieldName",null),e([t()],c.prototype,"_valueInputType",null),e([t()],c.prototype,"_visibleOperators",null),e([t()],c.prototype,"_isValueInputHidden",null),e([t()],c.prototype,"domain",null),e([t()],c.prototype,"field",null),e([t()],c.prototype,"fields",null),e([t()],c.prototype,"fieldLabel",null),e([t()],c.prototype,"fieldName",null),e([t()],c.prototype,"layer",null),e([t(),s("esri/widgets/support/FilterCondition/t9n/FilterCondition")],c.prototype,"messages",void 0),e([t(),s("esri/t9n/common")],c.prototype,"messagesCommon",void 0),e([t()],c.prototype,"normalizedFieldName",null),e([t()],c.prototype,"operator",null),e([t()],c.prototype,"operators",null),e([t()],c.prototype,"state",null),e([t()],c.prototype,"value",null),e([t()],c.prototype,"valueAsString",null),e([t()],c.prototype,"viewModel",void 0),e([t()],c.prototype,"visibleElements",void 0),e([i("visibleElements")],c.prototype,"castVisibleElements",null),e([t()],c.prototype,"whereClause",null),c=e([r("esri.widgets.support.FilterCondition")],c);const m=c;export{m as default};
|
package/widgets/support/GoTo.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as o}from"../../chunks/tslib.es6.js";import{assertIsSome as r}from"../../core/maybe.js";import{property as
|
|
5
|
+
import{_ as o}from"../../chunks/tslib.es6.js";import{assertIsSome as r}from"../../core/maybe.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";const t=t=>{let i=class extends t{constructor(...o){super(...o),this.goToOverride=null,this.view=null}callGoTo(o){const{view:e}=this;return r(e),this.goToOverride?this.goToOverride(e,o):e.goTo(o.target,o.options)}};return o([e()],i.prototype,"goToOverride",void 0),o([e()],i.prototype,"view",void 0),i=o([s("esri.widgets.support.GoTo")],i),i};export{t as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{generateGlobalId as t}from"../../../editing/sharedTemplates/executor/support/createServiceEdit.js";import{formatNumber as e}from"../../../intl/number.js";import{isSubtypeSublayer as n}from"../../../layers/support/layerUtils.js";import o from"../../../rest/networks/support/Association.js";import i from"../../../rest/networks/support/NetworkElement.js";function r(t){const{percentAlong:n}=t;return null==n?"":e(n,{style:"percent",maximumFractionDigits:2})}function c(t){const{associationType:e}=t;return"connectivity"===e||"junction-junction-connectivity"===e||"junction-edge-from-connectivity"===e||"junction-edge-midspan-connectivity"===e||"junction-edge-to-connectivity"===e}function a(t){return"junction-edge-midspan-connectivity"===t.associationType}function s(t){const{attributes:e,sourceLayer:n}=t??{},o=n&&"displayField"in n?n.displayField:null,i=o?e?.[o]:null,r=t?.getObjectId()?.toString();return i||r||""}function
|
|
5
|
+
import{generateGlobalId as t}from"../../../editing/sharedTemplates/executor/support/createServiceEdit.js";import{formatNumber as e}from"../../../intl/number.js";import{isSubtypeSublayer as n}from"../../../layers/support/layerUtils.js";import o from"../../../rest/networks/support/Association.js";import i from"../../../rest/networks/support/NetworkElement.js";function r(t){const{percentAlong:n}=t;return null==n?"":e(n,{style:"percent",maximumFractionDigits:2})}function c(t){const{associationType:e}=t;return"connectivity"===e||"junction-junction-connectivity"===e||"junction-edge-from-connectivity"===e||"junction-edge-midspan-connectivity"===e||"junction-edge-to-connectivity"===e}function a(t){return"junction-edge-midspan-connectivity"===t.associationType}function s(t){const{attributes:e,sourceLayer:n}=t??{},o=n&&"displayField"in n?n.displayField:null,i=o?e?.[o]:null,r=t?.getObjectId()?.toString();return i||r||""}function u(t,e,n){const{associationType:o}=t;switch(o){case"attachment":return"to"===e?n.attachment:n.structure;case"containment":return"to"===e?n.content:n.container;case"junction-edge-from-connectivity":case"junction-edge-to-connectivity":case"junction-edge-midspan-connectivity":case"junction-junction-connectivity":case"connectivity":return n.connectivity}}function l(t,e){return!!(t.layer&&"globalIdField"in t.layer&&t.layer.globalIdField&&e.fromNetworkElement)&&t.attributes[t.layer.globalIdField]===e.fromNetworkElement.globalId}function d(t,e){const o=n(t.sourceLayer)?t.sourceLayer.parent:t.sourceLayer;if(o&&"globalIdField"in o&&"layerId"in o&&o.globalIdField){const n=e.getSourceIdByLayerId(o.layerId),r="junction"===e.getSourceTypeById(n)?e.getTerminalConfiguration(t):void 0,c=r?.terminals.at(0)?.id,a=o.fieldsIndex.get("assetGroup").name,s=o.fieldsIndex.get("assetType").name,u=t.attributes[a],l=t.attributes[s],d=t.attributes[o.globalIdField];if(d&&null!=n)return new i({globalId:d,networkSourceId:n,assetGroupCode:u,assetTypeCode:l,terminalId:c})}}function y(e){return new o({fromNetworkElement:d(e.fromFeature,e.utilityNetwork),toNetworkElement:d(e.toFeature,e.utilityNetwork),associationType:e.associationType,globalId:t()})}export{y as createAssociation,r as formatPercentAlong,u as getAssociationTitle,s as getFeatureTitle,c as isConnectivity,a as isConnectivityMidspan,l as isFromElement};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
function
|
|
5
|
+
function t(){return(t,o)=>t.goTo(o.target,{...o.options,animate:!1})}export{t as makeGoToWithoutAnimation};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7677],{563:(e,t,i)=>{i.d(t,{QueueProcessor:()=>u});var s=i(97768),n=i(74887),r=i(9775),o=i(32587),l=i(11932),a=i(44794);class c{constructor(e,t){this.item=e,this.controller=t,this.promise=null}}class u{constructor(e){this._schedule=null,this._deferreds=new o.A,this._controllers=new o.A,this._processingItems=new o.A,this._pausedSignal=(0,a.v)(!1),this.concurrency=1,e.concurrency&&(this.concurrency=e.concurrency),this._queue=new r.A(e.peeker),this.process=e.process}destroy(){this.clear(),this._schedule=(0,s.xt)(this._schedule)}get updating(){return this.running}get length(){return this._processingItems.size+this._queue.length}get running(){return!this._pausedSignal.value&&this._queue.length>0&&this._processingItems.size<this.concurrency}abort(e){const t=this._controllers.get(e);t&&t.abort()}clear(){this._queue.clear();const e=[];this._controllers.forEach((t=>e.push(t))),this._controllers.clear(),e.forEach((e=>e.abort())),this._processingItems.clear(),this._cancelNext()}forEach(e){this._deferreds.forEach(((t,i)=>e(i)))}get(e){const t=this._deferreds.get(e);return t?t.promise:void 0}isOngoing(e){return this._processingItems.has(e)}has(e){return this._deferreds.has(e)}pause(){this._pausedSignal.value||(this._pausedSignal.value=!0,this._cancelNext())}push(e,t){const i=this.get(e);if(i)return i;const s=new AbortController;let r=null;t&&(r=(0,n.u7)(t,(()=>s.abort())));const o=()=>{l.remove(),null!=r&&r.remove(),this._removeItem(e),this._queue.remove(e),this._scheduleNext()},l=(0,n.NY)(s.signal,(()=>{const t=this._processingItems.get(e);t&&t.controller.abort(),o(),a.reject((0,n.NK)())})),a=(0,n.Tw)();return this._deferreds.set(e,a),this._controllers.set(e,s),a.promise.then(o,o),this._queue.push(e),this._scheduleNext(),a.promise}last(){return this._queue.last()}lastPromise(){const e=this.last();return e?this.get(e):null}peek(){return this._queue.peek()}popLast(){const e=this._queue.popLast();return e&&(this._deferreds.get(e)?.reject((0,n.NK)()),this._removeItem(e)),e}reset(){const e=Array.from(this._processingItems.values());this._processingItems.clear();for(const t of e)this._queue.push(t.item),t.controller.abort();this._scheduleNext()}resume(){this._pausedSignal.value&&(this._pausedSignal.value=!1,this._scheduleNext())}takeAll(){const e=[];for(;this._queue.length;)e.push(this._queue.pop());return this.clear(),e}_removeItem(e){this._deferreds.delete(e),this._controllers.delete(e),this._processingItems.delete(e)}_scheduleNext(){this._pausedSignal.value||this._schedule||(this._schedule=(0,l._)((()=>{this._schedule=null,this._next()})))}_next(){for(;this._queue.length>0&&this._processingItems.size<this.concurrency;)this._process(this._queue.pop())}_cancelNext(){this._schedule&&(this._schedule.remove(),this._schedule=null)}_processResult(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).resolve(t))}_processError(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).reject(t))}_canProcessFulfillment(e){return!!this._deferreds.get(e.item)&&this._processingItems.get(e.item)===e}_process(e){if(null==e)return;let t;const i=new AbortController,s=new c(e,i);this._processingItems.set(e,s);try{t=this.process(e,i.signal)}catch(e){this._processError(s,e)}(0,n.$X)(t)?(s.promise=t,t.then((e=>this._processResult(s,e)),(e=>this._processError(s,e)))):this._processResult(s,t)}}},32587:(e,t,i)=>{i.d(t,{A:()=>r});var s=i(62788),n=i(95488);class r{constructor(e){this._observable=new n.I,this._map=new Map(e)}get size(){return(0,s.gc)(this._observable),this._map.size}clear(){this._map.size>0&&(this._map.clear(),this._observable.notify())}delete(e){const t=this._map.delete(e);return t&&this._observable.notify(),t}entries(){return(0,s.gc)(this._observable),this._map.entries()}forEach(e,t){(0,s.gc)(this._observable),this._map.forEach(((i,s)=>e.call(t,i,s,this)),t)}get(e){return(0,s.gc)(this._observable),this._map.get(e)}has(e){return(0,s.gc)(this._observable),this._map.has(e)}keys(){return(0,s.gc)(this._observable),this._map.keys()}set(e,t){return this._map.set(e,t),this._observable.notify(),this}values(){return(0,s.gc)(this._observable),this._map.values()}[Symbol.iterator](){return(0,s.gc)(this._observable),this._map[Symbol.iterator]()}[Symbol.dispose](){this._observable.destroy()}get[Symbol.toStringTag](){return this._map[Symbol.toStringTag]}}},44794:(e,t,i)=>{i.d(t,{v:()=>l});var s=i(4718),n=i(62788),r=i(95488);class o{constructor(e,t){this._observable=new r.I,this._value=e,this._equalityFunction=t}get value(){return(0,n.gc)(this._observable),this._value}set value(e){this._equalityFunction(e,this._value)||(this._value=e,this._observable.notify())}mutate(e){e(this._value),this._observable.notify()}}function l(e,t=s.gh){return new o(e,t)}},89015:(e,t,i)=>{i.d(t,{o:()=>H});var s=i(90237),n=i(78888),r=i(49186),o=i(53966),l=i(10107),a=i(56507),c=(i(44208),i(87811),i(93223)),u=i(36005),h=i(40608),p=i(86738),d=i(16930),f=i(21325),m=i(60694),y=i(10873),g=i(45617),x=i(43577),_=i(13868),b=i(22796),v=i(69409),w=i(87045),R=i(76353),I=i(84169),S=i(77301),M=i(77359),T=i(6049),k=i(70834),A=i(6952),P=i(14636),F=i(12711),z=i(85676),C=i(94359),J=i(22048),N=i(49410),D=i(34606),O=i(51508),B=i(4095);const H=e=>{let t=class extends e{constructor(...e){super(...e),this._isConstructedFromFunctionRaster=!1,this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this.bandIds=null,this.copyright=null,this.interpolation=null,this.multidimensionalSubset=null,this.raster=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=(0,R.q)(e[0]?.raster)}get fullExtent(){return this.serviceRasterInfo?.extent}set multidimensionalDefinition(e){this._set("multidimensionalDefinition",e),this.updateRenderer()}set rasterFunction(e){"none"===e?.functionName?.toLowerCase()&&(e=void 0),this._set("rasterFunction",e),this.updateRasterFunction()}set url(e){this._set("url",(0,m.Jf)(e,o.A.getLogger(this)))}get renderer(){if("imagery-tile"!==this.type)return this.internalRenderer;const{activePresetRendererName:e,presetRenderers:t}=this;if(e){const i=t?.find((({name:t})=>t===e));return i?.renderer.clone()}return this.internalRenderer}set renderer(e){"imagery-tile"===this.type&&(this.activePresetRendererName=null),this.internalRenderer=e}set internalRenderer(e){null==e&&null==this.rasterFunction?this._configDefaultRenderer("override"):(this._set("internalRenderer",e),this.updateRenderer())}readRenderer(e,t,i){const s=t?.layerDefinition?.drawingInfo?.renderer;return(0,C.LF)(s,i)||void 0}async convertVectorFieldData(e,t){const{serviceRasterInfo:i}=this;if(null==e||!i)return null;const s=this._rasterJobHandler.instance,n=i.dataType;return s?s.convertVectorFieldData({pixelBlock:e,dataType:n},t):(0,P.FI)(e,n)}async computeStatisticsHistograms(e,t){await this.load(t),e=(0,a.PZ)(J.A,e).clone();const{serviceRasterInfo:i}=this;if(null==i)throw new r.A("imagery-tile-mixin:compute-statistics-histograms","serviceRasterInfo must be specified");const{geometry:s}=e;if(null==s)throw new r.A("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let n=s;const{spatialReference:o}=i;s.spatialReference.equals(o)||(await(0,k.Hh)(),n="extent"===s.type?(0,k._l)(s,o):(0,k.uk)(s,o));const l=e.pixelSize??new p.A({x:i.pixelSize.x,y:i.pixelSize.y,spatialReference:o}),{extent:c,width:u,height:h}=(0,M.b7)(i,n,l),d=await this.fetchPixels(c,u,h,{...t,interpolation:"nearest"});if(null==d.pixelBlock)throw new r.A("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const f=await(0,M.$Q)(d.pixelBlock,c,n),m=this._rasterJobHandler.instance;return m?m.computeStatisticsHistograms({pixelBlock:f},t):(0,A.eH)(f)}async createFlowMesh(e,t){const i=this._rasterJobHandler.instance;return i?i.createFlowMesh(e,t):(0,B.CW)(e.meshType,e.simulationSettings,e.flowData,null!=t.signal?t.signal:(new AbortController).signal)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.serviceRasterInfo??{};if(null==t)return e;const i=(0,S.XU)({rasterInfo:this.raster.rasterInfo,multidimensionalDefinition:e.multidimensionalDefinition||this.multidimensionalDefinition,timeExtent:e.timeExtent??this.timeExtent,multidimensionalSubset:this.multidimensionalSubset});return{...e,multidimensionalDefinition:i}}async updateRasterFunction(){return this.loaded&&"imagery-tile"===this.type&&(this.rasterFunction||this._cachedRasterFunctionJson)&&JSON.stringify(this.rasterFunction)!==JSON.stringify(this._cachedRasterFunctionJson)?(this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this._rasterFunctionUpdatePromise=this._updateRasterFunction(),this._rasterFunctionUpdatePromise):this._rasterFunctionUpdatePromise}async updateRenderer(){const{loaded:e,symbolizer:t}=this;if(!e||!t||!this.renderer)return;const{rasterInfo:i}=this.raster,s=(0,S.ct)(i,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),n=s?.name,r=(0,F.$P)({...this.renderer.toJSON(),variableName:n});if(JSON.stringify(this._cachedRendererJson)===JSON.stringify(r))return;const o=this._rasterJobHandler.instance;o&&(t.rasterInfo=(0,F.m7)(i,n),t.rendererJSON=r,t.bind(),await o.updateSymbolizer(t),this._cachedRendererJson=r)}async applyRenderer(e,t){const i=e?.pixelBlock;if(!(null!=i&&i.pixels&&i.pixels.length>0))return null;let s;await this.updateRenderer();const n=this._rasterJobHandler.instance,r=this.bandIds??[];return s=n?await n.symbolize({...e,simpleStretchParams:t,bandIds:r}):this.symbolizer.symbolize({...e,simpleStretchParams:t,bandIds:r}),s}getTileUrl(e,t,i){return"RasterTileServer"===this.raster.datasetFormat?`${this.url}/tile/${e}/${t}/${i}`:""}getCompatibleTileInfo(e,t,i=!1){if(!this.loaded||null==t)return null;if(i&&e.equals(this.spatialReference))return this.tileInfo;const s=(0,f.Vp)(e);return w.A.create({size:256,spatialReference:e,origin:s?{x:s.origin[0],y:s.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,t,i,s={}){if(H(this),s.requestAsImageElement){const r=this.getTileUrl(e,t,i);return(0,n.A)(r,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:s.signal}).then((e=>e.data))}const{serviceRasterInfo:r}=this;if(null!=r.multidimensionalInfo&&null==(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition){const n=s.tileInfo||r.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(e,t,i,n),pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),"raster-shaded-relief"===this.renderer?.type&&(s={...s,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,t,i,s)}async fetchPixels(e,t,i,s={}){return null!=this.serviceRasterInfo.multidimensionalInfo&&null==(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition?{extent:e,pixelBlock:null}:(await this._initJobHandler(),await this.updateRasterFunction(),t=Math.round(t),i=Math.round(i),this.raster.fetchPixels(e,t,i,s))}async getSamples(e,t){if(await this.load(),(e=(0,a.PZ)(D.A,e).clone()).interpolation&&"nearest"!==e.interpolation)throw new r.A("imagery-tile-mixin:get-samples","only nearest interpolation is currently supported");const i=e.mosaicRule?.multidimensionalDefinition,s={...t,multidimensionalDefinition:i},n=(await this._getSampleLocations(e)).map((e=>this.identify(e,s).then((t=>(t.location=e,t))))),o=(await Promise.all(n)).flatMap(((e,t)=>this._convertRasterIdentifyResultToSample(e,t)));return new O.A({samples:o})}async identify(e,t={}){await this.load();const{raster:i,serviceRasterInfo:s}=this;if(null!=s?.multidimensionalInfo&&!(s.hasMultidimensionalTranspose&&((0,S.DY)(t.multidimensionalDefinition)||t.transposedVariableName||t.timeExtent)||null!=(t=this.normalizeRasterFetchOptions(t)).multidimensionalDefinition))return{location:e,value:null};const n=this.multidimensionalSubset?.areaOfInterest;if(n&&!n.contains(e))throw new r.A("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");return i.identify(e,t)}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}hasStandardTime(){const e=this.serviceRasterInfo?.multidimensionalInfo;if(null==e||"standard-time"!==this.serviceRasterInfo?.dataType)return!1;const t=this.multidimensionalDefinition,i=t?.[0]?.variableName;return e.variables.some((e=>e.name===i&&(!t?.[0].dimensionName||e.dimensions.some((e=>"StdTime"===e.name)))))}getStandardTimeValue(e){return new Date((0,S.$E)(e)).toISOString()}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo?.multidimensionalInfo;return(0,S.z2)(this.multidimensionalSubset,t)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=(0,S.fy)(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&(0,R.q)(this.raster)&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}_initJobHandler(){if(null!=this._rasterJobHandler.connectionPromise)return this._rasterJobHandler.connectionPromise;const e=new v.A;return this._rasterJobHandler.connectionPromise=e.initialize().then((async()=>{H(this),this._rasterJobHandler.instance=e;const{raster:t}=this;t.rasterJobHandler=e,(0,R.q)(t)&&t.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch((()=>{})),this.renderer&&this.updateRenderer()})).catch((()=>{})),this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this._cachedRendererJson=null,this.raster&&(this.raster.rasterJobHandler=null)}async _getSampleLocations(e){const{geometry:t}=e;if("point"===t.type)return[t];const{spatialReference:s,type:n}=t;if("multipoint"===n)return t.points.map((e=>new p.A({x:e[0],y:e[1],spatialReference:s})));if("polyline"===n){let n=t;if(e.sampleCount||e.sampleDistance){const s=await Promise.all([i.e(1878),i.e(2189),i.e(3299),i.e(8411)]).then(i.bind(i,88411)),r=(await Promise.all([i.e(1878),i.e(2189),i.e(3299),i.e(4929)]).then(i.bind(i,965))).execute(t,{unit:"meters"}),o=Math.min(e.sampleCount||100,1e3);let l=e.sampleDistance;l||(l=r/(o+(2===n.paths[0].length?1:0))),n=s.execute(t,l,{unit:"meters"})}return n.paths.flatMap((e=>e.map((e=>new p.A({x:e[0],y:e[1],spatialReference:s})))))}const r=Math.min(e.sampleCount||100,1e3),o="extent"===t.type,l=o?t:t.extent,a=Math.sqrt(l.width*l.height/r),c=l.height/a,u=l.width/a,{xmin:h,ymax:d}=l,f=[];for(let e=0;e<c;e++)for(let i=0;i<u;i++){const n=new p.A({x:h+(i+.5)*a,y:d-(e+.5)*a,spatialReference:s});(o||t.contains(n))&&f.push(n)}return f}_configDefaultInterpolation(){if(null==this.interpolation){H(this);const{raster:e}=this,t=(0,F.w6)(e.rasterInfo,e.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",t)}}_configDefaultRenderer(e="no"){H(this);const{rasterInfo:t}=this.raster,i=(0,S.ct)(t,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),s=i?.name,n=(0,F.I8)({variableName:s,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&t.bandCount>1&&(this.bandIds=n?.bandIds??(0,F.ci)(t)),!this.renderer||"override"===e){const e=(0,F.Mm)(this.raster),i=n?.renderer??(0,F.PD)(t,{bandIds:this.bandIds,variableName:s,rasterFunctionColorRamp:e}),r=t.statistics,o=r&&r.length>0?r[0]:null,l=o?.max??0,a=o?.min??0;"WCSServer"===this.raster.datasetFormat&&"raster-stretch"===i.type&&(l>1e24||a<-1e24)&&(i.dynamicRangeAdjustment=!0,i.customStatistics=null,"none"===i.stretchType&&(i.stretchType="min-max")),this.renderer=i}const r=(0,F.$P)({...this.renderer.toJSON(),variableName:s}),l=(0,F.m7)(t,s);this.symbolizer?(this.symbolizer.rendererJSON=r,this.symbolizer.rasterInfo=l):this.symbolizer=new z.A({rendererJSON:r,rasterInfo:l});const a=this.symbolizer.bind();if(a.success){if("auto"===e){const{colormap:e}=this.raster.rasterInfo,t=this.renderer;if(null!=e&&"raster-colormap"===t.type){const e=(0,F.PD)(this.raster.rasterInfo);JSON.stringify(e)!==JSON.stringify(t)&&this._configDefaultRenderer("override")}else if("raster-stretch"===t.type){const e=this.bandIds?.length,i=t.customStatistics?.length;!t.dynamicRangeAdjustment&&i&&e&&i!==e&&this._configDefaultRenderer("override")}}}else o.A.getLogger(this).warn("imagery-tile-mixin",a.error||"The given renderer is not supported by the layer."),"auto"===e&&this._configDefaultRenderer("override")}async _updateRasterFunction(){if(this._isConstructedFromFunctionRaster&&(0,R.q)(this.raster)){const e=this.raster.rasterFunction.toJSON();return void(!this.rasterFunction&&e&&this._set("rasterFunction",b.A.fromJSON(e)))}let e,t=this.raster,i=!1;(0,R.q)(t)?(e=t.primaryRasters.rasters,t=e[0],i=!0):e=[t];const{rasterFunction:s}=this;if(s){const i={raster:t};e.length>1&&e.forEach((e=>i[e.url]=e));const n=(0,T.vt)(s.functionDefinition?.toJSON()??s.toJSON(),i),r=new I.A({rasterFunction:n});r.rasterJobHandler=this._rasterJobHandler.instance,await r.open(),this.raster=r}else this.raster=t,await t.open();if(this._cachedRendererJson=null,!i&&!s)return;const{bandIds:n}=this,{bandCount:r}=this.raster.rasterInfo,o=n?.length?n.some((e=>e>=r)):r>=3;n&&(o||this.renderer&&"raster-stretch"!==this.renderer.type)&&this._set("bandIds",null),this._configDefaultRenderer("auto")}_convertRasterIdentifyResultToSample(e,t){const{rasterInfo:i}=this.raster,s=i.storageInfo.pyramidScalingFactor**(e.pyramidLevel??0),n=(i.pixelSize.x+i.pixelSize.y)/2*s;if(!e.dataSeries?.length)return[new N.A({location:e.location,pixelValue:e.value,locationId:t,resolution:n})];const r=[];return e.dataSeries.forEach((({value:i,multidimensionalDefinition:s},o)=>{const l={Variables:s[0].variableName,Dimensions:s.flatMap((({dimensionName:e})=>e)).join(",")};for(const{dimensionName:e,values:t}of s){l[e]=Array.isArray(t[0])?t[0][0]:t[0];const i=t[t.length-1];l[`${e}_Max`]=Array.isArray(i)?i[i.length-1]:i}const a=new N.A({location:e.location,pixelValue:i,rasterId:o,locationId:t,resolution:n,attributes:l});r.push(a)})),r}};function H(e){if(!e.raster||!e.serviceRasterInfo)throw new r.A("imagery-tile","no raster")}return(0,s._)([(0,l.MZ)({clonable:!1})],t.prototype,"_cachedRendererJson",void 0),(0,s._)([(0,l.MZ)({clonable:!1})],t.prototype,"_cachedRasterFunctionJson",void 0),(0,s._)([(0,l.MZ)({clonable:!1})],t.prototype,"_compatibleFullExtent",void 0),(0,s._)([(0,l.MZ)({clonable:!1})],t.prototype,"_isConstructedFromFunctionRaster",void 0),(0,s._)([(0,l.MZ)({clonable:!1})],t.prototype,"_rasterJobHandler",void 0),(0,s._)([(0,l.MZ)({clonable:!1})],t.prototype,"_rasterFunctionUpdatePromise",void 0),(0,s._)([(0,l.MZ)({type:[a.jz],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],t.prototype,"bandIds",void 0),(0,s._)([(0,l.MZ)({json:{origins:{service:{read:{source:"copyrightText"}}}}})],t.prototype,"copyright",void 0),(0,s._)([(0,l.MZ)({json:{read:!1}})],t.prototype,"fullExtent",null),(0,s._)([(0,l.MZ)({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),(0,c.e)(_.SZ)],t.prototype,"interpolation",void 0),(0,s._)([(0,l.MZ)()],t.prototype,"ioConfig",void 0),(0,s._)([(0,l.MZ)({type:[g.A],json:{write:!0}})],t.prototype,"multidimensionalDefinition",null),(0,s._)([(0,l.MZ)({type:x.A,json:{write:!0}})],t.prototype,"multidimensionalSubset",void 0),(0,s._)([(0,l.MZ)()],t.prototype,"raster",void 0),(0,s._)([(0,l.MZ)({type:b.A})],t.prototype,"rasterFunction",null),(0,s._)([(0,l.MZ)()],t.prototype,"serviceRasterInfo",void 0),(0,s._)([(0,l.MZ)()],t.prototype,"sourceJSON",void 0),(0,s._)([(0,l.MZ)({readOnly:!0,type:d.A,json:{read:!1}})],t.prototype,"spatialReference",void 0),(0,s._)([(0,l.MZ)({type:w.A})],t.prototype,"tileInfo",void 0),(0,s._)([(0,l.MZ)(y.OZ)],t.prototype,"url",null),(0,s._)([(0,l.MZ)()],t.prototype,"renderer",null),(0,s._)([(0,l.MZ)({types:C.uy,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const e="raster-stretch"===this.renderer?.type&&"none"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||"Raster"===this.raster.tileType||!e}}},origins:{"web-scene":{types:C.Gj,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type&&"flow"!==e.type})}}}}})],t.prototype,"internalRenderer",null),(0,s._)([(0,u.w)("internalRenderer")],t.prototype,"readRenderer",null),(0,s._)([(0,l.MZ)({clonable:!1})],t.prototype,"symbolizer",void 0),t=(0,s._)([(0,h.$)("esri.layers.mixins.ImageryTileMixin")],t),t}},91806:(e,t,i)=>{i.d(t,{A:()=>u});var s,n=i(90237),r=i(25482),o=i(10107),l=i(56507),a=(i(44208),i(87811),i(40608));let c=class extends r.A{static{s=this}constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new s({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,n._)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"cols",void 0),(0,n._)([(0,o.MZ)({type:l.jz,json:{write:!0}})],c.prototype,"level",void 0),(0,n._)([(0,o.MZ)({type:String,json:{write:!0}})],c.prototype,"levelValue",void 0),(0,n._)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"origin",void 0),(0,n._)([(0,o.MZ)({type:Number,json:{write:!0}})],c.prototype,"resolution",void 0),(0,n._)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"rows",void 0),(0,n._)([(0,o.MZ)({type:Number,json:{write:!0}})],c.prototype,"scale",void 0),c=s=(0,n._)([(0,a.$)("esri.layers.support.LOD")],c);const u=c},87045:(e,t,i)=>{i.d(t,{A:()=>I});var s,n=i(90237),r=i(66552),o=i(25482),l=i(83047),a=i(10107),c=i(56507),u=(i(44208),i(87811),i(36005)),h=i(40608),p=i(43937),d=i(86738),f=i(16930),m=i(19419),y=i(21325),g=i(28735),x=i(91806),_=i(72802);const b=new r.J({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let v=class extends o.A{static{s=this}static create(e={}){const{resolutionFactor:t=1,scales:i,size:n=256,spatialReference:r=f.A.WebMercator,numLODs:o=24}=e;if(!(0,y.fn)(r)){const e=[];if(i)for(let t=0;t<i.length;t++){const s=i[t];e.push(new x.A({level:t,scale:s,resolution:s}))}else{let t=5e-4;for(let i=o-1;i>=0;i--)e.unshift(new x.A({level:i,scale:t,resolution:t})),t*=2}return new s({dpi:96,lods:e,origin:new d.A(0,0,r),size:[n,n],spatialReference:r})}const a=(0,y.Vp)(r),c=e.origin?new d.A({x:e.origin.x,y:e.origin.y,spatialReference:r}):new d.A(a?{x:a.origin[0],y:a.origin[1],spatialReference:r}:{x:0,y:0,spatialReference:r}),u=1/(39.37*(0,l.GA)(r)*96),h=[];if(i)for(let e=0;e<i.length;e++){const t=i[e],s=t*u;h.push(new x.A({level:e,scale:t,resolution:s}))}else{let e=(0,y.EA)(r)?512/n*591657527.5917094:256/n*591657527.591555;const i=Math.ceil(o/t);h.push(new x.A({level:0,scale:e,resolution:e*u}));for(let s=1;s<i;s++){const i=e/2**t,n=i*u;h.push(new x.A({level:s,scale:i,resolution:n})),e=i}}return new s({dpi:96,lods:h,origin:c,size:[n,n],spatialReference:r})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const i=(0,y.Vp)(e);return e.isWrappable&&!!i&&Math.abs(i.origin[0]-t.x)<=i.dx}return!1}readOrigin(e,t){return d.A.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,i=0;const s=[],n=this._levelToLOD={};e&&(t=-1/0,i=1/0,e.forEach((e=>{s.push(e.scale),t=e.scale>t?e.scale:t,i=e.scale<i?e.scale:i,n[e.level]=e}))),this._set("scales",s),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const i=Math.floor(e),s=i+1;return t[i]/(t[i]/t[s])**(e-i)}scaleToZoom(e){const t=this.scales,i=t.length-1;let s=0;for(;s<i;s++){const i=t[s],n=t[s+1];if(i<=e)return s;if(n===e)return s+1;if(i>e&&n<e)return s+Math.log(i/e)/Math.log(i/n)}return s}tileAt(e,t,i,s){const n=this.lodAt(e);if(!n)return null;let r,o;if("number"==typeof t)r=t,o=i;else if((0,y.aI)(t.spatialReference,this.spatialReference))r=t.x,o=t.y,s=i;else{const e=(0,g.Cv)(t,this.spatialReference);if(null==e)return null;r=e.x,o=e.y,s=i}const l=n.resolution*this.size[0],a=n.resolution*this.size[1];return s||(s=new _.U(null,0,0,0,(0,m.vt)())),s.level=e,s.row=Math.floor((this.origin.y-o)/a+.001),s.col=Math.floor((r-this.origin.x)/l+.001),this.updateTileInfo(s),s}updateTileInfo(e,t=s.ExtrapolateOptions.NONE){let i=this.lodAt(e.level);if(!i&&t===s.ExtrapolateOptions.POWER_OF_TWO){const t=this.lods[this.lods.length-1];t.level<e.level&&(i=t)}if(!i)return;const n=e.level-i.level,r=i.resolution*this.size[0]/2**n,o=i.resolution*this.size[1]/2**n;e.id=`${e.level}/${e.row}/${e.col}`,e.extent||(e.extent=(0,m.vt)()),e.extent[0]=this.origin.x+e.col*r,e.extent[1]=this.origin.y-(e.row+1)*o,e.extent[2]=e.extent[0]+r,e.extent[3]=e.extent[1]+o}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const i=this.lodAt(t.level);if(null==i)return null;const{resolution:s}=i,n=s*this.size[0],r=s*this.size[1];return e[0]=this.origin.x+t.col*n,e[1]=this.origin.y-(t.row+1)*r,e[2]=e[0]+n,e[3]=e[1]+r,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return s.fromJSON(this.write({}))}getCompatibleForVTL(e){if(this.size[0]!==this.size[1]||256===this.size[0]&&512===e)return null;const t=(512===this.size[0]&&256===e?-1:0)+(this.spatialReference.isGeographic?1:0);if(this.size[0]===e&&0===t)return this;const i=[],n=this.lods.length-t;for(let e=0;e<n;e++){const s=e+t,{scale:n,resolution:r}=s>=0?this.lods[s]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};i.push(new x.A({level:e,scale:n,resolution:r}))}return new s({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:i})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let i=0;i<e.length;i++){const s=e[i];this._upsampleLevels[s.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/s.resolution:0},t=s}}};var w,R;(0,n._)([(0,a.MZ)({type:Number,json:{write:!0}})],v.prototype,"compressionQuality",void 0),(0,n._)([(0,a.MZ)({type:Number,json:{write:!0}})],v.prototype,"dpi",void 0),(0,n._)([(0,a.MZ)({type:String,json:{read:b.read,write:b.write,origins:{"web-scene":{read:!1,write:!1}}}})],v.prototype,"format",void 0),(0,n._)([(0,a.MZ)({readOnly:!0})],v.prototype,"isWrappable",null),(0,n._)([(0,a.MZ)({type:d.A,json:{write:!0}})],v.prototype,"origin",void 0),(0,n._)([(0,u.w)("origin")],v.prototype,"readOrigin",null),(0,n._)([(0,a.MZ)({type:[x.A],value:null,json:{write:!0}})],v.prototype,"lods",null),(0,n._)([(0,a.MZ)({readOnly:!0})],v.prototype,"scales",void 0),(0,n._)([(0,a.MZ)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],v.prototype,"size",void 0),(0,n._)([(0,u.w)("size",["rows","cols"])],v.prototype,"readSize",null),(0,n._)([(0,p.K)("size",{cols:{type:c.jz},rows:{type:c.jz}})],v.prototype,"writeSize",null),(0,n._)([(0,a.MZ)({type:f.A,json:{write:!0}})],v.prototype,"spatialReference",void 0),v=s=(0,n._)([(0,h.$)("esri.layers.support.TileInfo")],v),w=v||(v={}),(R=w.ExtrapolateOptions||(w.ExtrapolateOptions={}))[R.NONE=0]="NONE",R[R.POWER_OF_TWO=1]="POWER_OF_TWO";const I=v},72802:(e,t,i)=>{i.d(t,{U:()=>s});class s{constructor(e,t,i,s,n=void 0){this.id=e,this.level=t,this.row=i,this.col=s,this.extent=n}}},4916:(e,t,i)=>{i.d(t,{A:()=>O});var s=i(90237),n=i(78888),r=i(49186),o=i(25482),l=i(53966),a=i(74887),c=i(563),u=i(10107),h=i(56507),p=(i(44208),i(87811),i(40608)),d=i(5443),f=i(86738),m=i(16930),y=i(60694),g=i(10873),x=i(45617),_=i(91806),b=i(20223),v=i(87045),w=i(76353),R=i(77301),I=i(70834);const S=new Map,M=new class{constructor(e=15e3,t=5e3){this._timer=null,this._cachedBlocks=new Map,this._size=-1,this._duration=e,this._interval=Math.min(e,t)}decreaseRefCount(e,t){const i=e+"/"+t,s=this._cachedBlocks;if(s.has(i)){const e=s.get(i);return e.refCount--,e.refCount<=0&&(s.delete(i),e.controller&&e.controller.abort()),e.refCount}return 0}getBlock(e,t){const i=e+"/"+t,s=this._cachedBlocks;if(s.has(i)){const e=s.get(i);return e.ts=Date.now(),e.refCount++,s.delete(i),s.set(i,e),e.block}return null}putBlock(e,t,i,s){const n=this._cachedBlocks,r=e+"/"+t;if(n.has(r)){const e=n.get(r);e.ts=Date.now(),e.refCount++}else n.set(r,{block:i,ts:Date.now(),refCount:1,controller:s});this._trim(),this._updateTimer()}deleteBlock(e,t){const i=this._cachedBlocks,s=e+"/"+t;i.has(s)&&i.delete(s)}updateMaxSize(e){this._size=e,this._trim()}empty(){this._cachedBlocks.clear(),this._clearTimer()}getCurrentSize(){return this._cachedBlocks.size}_updateTimer(){if(null!=this._timer)return;const e=this._cachedBlocks;this._timer=setInterval((()=>{const t=Array.from(e),i=Date.now();for(let s=0;s<t.length&&t[s][1].ts<=i-this._duration;s++)e.delete(t[s][0]);0===e.size&&this._clearTimer()}),this._interval)}_trim(){const e=this._cachedBlocks;if(-1===this._size||this._size>=e.size)return;const t=Array.from(e);for(let i=0;i<t.length-this._size;i++)e.delete(t[i][0])}_clearTimer(){null!=this._timer&&(clearInterval(this._timer),this._timer=null)}};function T(e,t,i){const s=S.get(e);if(!s)return null==t?M.decreaseRefCount(e,i):0;if(null==t||null==s[t])return M.decreaseRefCount(e,i);const n=s[t]?.cache,r=n?.get(i);if(n&&r){if(r.refCount--,0===r.refCount){n.delete(i);for(let e=0;e<s.length;e++)s[e]?.cache.delete(i);r.controller&&r.controller.abort()}return r.refCount}return 0}function k(e,t,i){const s=S.get(e);if(!s)return null==t?M.getBlock(e,i):null;if(null==t||null==s[t]){for(let e=0;e<s.length;e++){const t=s[e]?.cache.get(i);if(t)return t.refCount++,t.block}return M.getBlock(e,i)}const n=s[t]?.cache.get(i);if(n)return n.refCount++,n.block;for(let e=0;e<s.length;e++){if(e===t||!s[e])continue;const n=s[e]?.cache,r=n?.get(i);if(n&&r)return r.refCount++,n.set(i,r),r.block}return null}function A(e,t,i,s,n=null){const r=S.get(e);if(!r)return void(null==t&&M.putBlock(e,i,s,n));if(null==t||null==r[t])return void M.putBlock(e,i,s,n);const o={refCount:1,block:s,isResolved:!1,isRejected:!1,controller:n};s.then((()=>o.isResolved=!0)).catch((()=>o.isRejected=!0)),r[t]?.cache.set(i,o)}function P(e,t,i){const s=S.get(e);s?null!=t&&null!=s[t]?s[t]?.cache.delete(i):M.deleteBlock(e,i):null==t&&M.deleteBlock(e,i)}var F=i(16019),z=i(51244),C=i(28435),J=i(14636);let N=0,D=class extends o.A{constructor(){super(...arguments),this._tileFetchQueue=new c.QueueProcessor({concurrency:32,process:(e,t)=>this._fetchRawTile(e.pyramidLevel,e.row,e.col,{...e.options,signal:t})}),this.datasetName=null,this.datasetFormat=null,this.hasUniqueSourceStorageInfo=!0,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}normalizeCtorArgs(e){return e?.ioConfig&&(e={...e,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:v.A.create(),...e.ioConfig}}),e}get _isGlobalWrappableSource(){const{rasterInfo:e}=this,t=(0,I.FT)(e.spatialReference);return null!=t&&e.extent.width>=t/2}get _hasNoneOrGCSShiftTransform(){const{transform:e}=this.rasterInfo;return null==e||"gcs-shift"===e.type}set rasterJobHandler(e){this._set("rasterJobHandler",e),(0,w.q)(this)&&this.primaryRasters?.rasters?.forEach((t=>t.rasterJobHandler=e))}get rasterId(){return this.url||"rasterId-"+N++}set url(e){this._set("url",(0,y.Jf)(e,l.A.getLogger(this)))}async open(e){return this._openPromise??=(0,I.Hh)().then((()=>this._open(e))),this._openPromise}async fetchTile(e,t,i,s={}){const n=s.tileInfo||this.rasterInfo.storageInfo.tileInfo,r=this.getTileExtentFromTileInfo(e,t,i,n);return s={noClip:!0,...s},this.fetchPixels(r,n.size[0],n.size[1],s)}async identify(e,t={}){e=(0,h.PZ)(f.A,e).clone().normalize();const{multidimensionalDefinition:i,timeExtent:s}=t,{rasterInfo:n}=this,{hasMultidimensionalTranspose:r,multidimensionalInfo:o}=n;let{transposedVariableName:l}=t;const a=null!=o&&r&&(null!=s||(0,R.DY)(i));a&&!l&&(l=null!=i&&i.length>0?i[0].variableName??void 0:o.variables[0].name,t={...t,transposedVariableName:l}),t=this._getRequestOptionsWithSliceId(t);const{spatialReference:c,extent:u}=n,{datumTransformation:p}=t;let m=(0,I._I)(e,c,p);if(!u.intersects(m))return{location:m,value:null};if(null!=n.transform){const e=n.transform.inverseTransform(m);if(!n.nativeExtent.intersects(e))return{location:e,value:null};m=e}let y=0;const g=null!=l&&null!=o&&n.hasMultidimensionalTranspose;if((0,w.q)(this)){const e=this.primaryRasters.rasters[0];if(g)return e.identify(m,t);const{pixelSize:s}=n,r=3,o=s.x*r/2,l=s.y*r/2,a=new d.A({xmin:m.x-o,xmax:m.x+o,ymin:m.y-l,ymax:m.y+l,spatialReference:c}),u={interpolation:"nearest",multidimensionalDefinition:i,sliceId:t.sliceId},{pixelBlock:h}=await e.fetchPixels(a,r,r,u),{pixelBlock:p}=await this.fetchPixels(a,r,r,u);if(null==h)return{location:m,value:null};const f=Math.floor(r*r*.5),y=!h.mask||h.mask[f]?h.pixels.map((e=>e[f])):null;let x;return null!=p&&(x=!p.mask||p.mask[f]?p.pixels.map((e=>e[f])):void 0),{location:m,value:y,processedValue:x,pyramidLevel:0}}if(!g)if(t.srcResolution)y=(0,I.t$)(t.srcResolution,n,this.ioConfig.sampling).pyramidLevel;else if(y=await this.computeBestPyramidLevelForLocation(e,t),null==y)return{location:m,value:null};const x=this.identifyPixelLocation(m,y,null,g);if(null===x)return{location:m,value:null};const{row:_,col:b,rowOffset:v,colOffset:S,blockWidth:M}=x,T=await this._tileFetchQueue.push({pyramidLevel:y,row:_,col:b,options:t},{signal:t.signal});if(!T?.pixels?.length)return{location:m,value:null};const k=v*M+S;return this._processIdentifyResult(T,{srcLocation:m,position:k,pyramidLevel:y,useTransposedTile:!!g,requestSomeSlices:a,identifyOptions:t})}async fetchPixels(e,t,i,s={}){e=(0,I.Ps)(e),s=this._getRequestOptionsWithSliceId(s);const{_hasNoneOrGCSShiftTransform:n}=this;if(s.requestRawData&&n)return this._fetchPixels(e,t,i,s);const r=(0,I.FT)(e.spatialReference),o=(0,I.OM)(e);if(null==r||0===o||1===o&&this._isGlobalWrappableSource&&n)return this._fetchPixels(e,t,i,s);if(o>=3)return{extent:e,pixelBlock:null};const l=[],{xmin:a,xmax:c}=e,u=Math.round(r/(c-a)*t),h=u-Math.round((r/2-a)/(c-a)*t);let p=0;const f=[];for(let n=0;n<=o;n++){const m=new d.A({xmin:0===n?a:-r/2,xmax:n===o?c-r*n:r/2,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference}),y=0===n?u-h:n===o?t-p:u;p+=y,f.push(y);const g=s.disableWrapAround&&n>0?null:this._fetchPixels(m,y,i,s);l.push(g)}const m=(await Promise.all(l)).map((e=>e?.pixelBlock));let y=null;const g={width:t,height:i};return y=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:m,srcMosaicSize:g,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:f},s)).pixelBlock:(0,C.z7)(m,g,{blockWidths:f}),{extent:e,srcExtent:(0,I._l)(e,this.rasterInfo.spatialReference,s.datumTransformation),pixelBlock:y}}async fetchRawPixels(e,t,i,s={}){t={x:Math.floor(t.x),y:Math.floor(t.y)};const n=await this._fetchRawTiles(e,t,i,s),{nativeExtent:r,nativePixelSize:o,storageInfo:l}=this.rasterInfo,a=2**e,c=o.x*a,u=o.y*a,h=new d.A({xmin:r.xmin+c*t.x,xmax:r.xmin+c*(t.x+i.width-1),ymin:r.ymax-u*(t.y+i.height-1),ymax:r.ymax-u*t.y,spatialReference:r.spatialReference});if(!n)return{extent:h,srcExtent:h,pixelBlock:null};const{pixelBlocks:p,mosaicSize:f}=n;if(1===p.length&&null!=p[0]&&p[0].width===i.width&&p[0].height===i.height)return{extent:h,srcExtent:h,pixelBlock:n.pixelBlocks[0]};const m=e>0?l.pyramidBlockWidth:l.blockWidth,y=e>0?l.pyramidBlockHeight:l.blockHeight,g={x:t.x%m,y:t.y%y};let x;return x=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:p,srcMosaicSize:f,destDimension:i,clipOffset:g,clipSize:i,coefs:null,sampleSpacing:null,interpolation:s.interpolation,alignmentInfo:null,blockWidths:null},s)).pixelBlock:(0,C.z7)(p,f,{clipOffset:g,clipSize:i}),{extent:h,srcExtent:h,pixelBlock:x}}fetchRawTile(e,t,i,s){throw new r.A("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(e){return(0,I._l)(this.rasterInfo.extent,e)}decodePixelBlock(e,t){return!this.rasterJobHandler||t.useCanvas?(0,z.D)(e,t):this.rasterJobHandler.decode({data:e,options:t})}async request(e,t,i=0){const{customFetchParameters:s}=this.ioConfig,{range:r,query:o,headers:l}=t;i=i??t.retryCount??this.ioConfig.retryCount;const a=r?{Range:`bytes=${r.from}-${r.to}`}:null;try{return await(0,n.A)(e,{...t,query:{...o,...s},headers:{...l,...a}})}catch(s){if(i>0)return i--,this.request(e,t,i);throw s}}getSliceIndex(e){const{multidimensionalInfo:t}=this.rasterInfo;return null==t||null==e||0===e.length?null:(0,R.NG)(e,t)}getTileExtentFromTileInfo(e,t,i,s){const n=s.lodAt(e);return this.getTileExtent({x:n.resolution,y:n.resolution},t,i,s.origin,s.spatialReference,s.size)}updateTileInfo(){const{storageInfo:e,spatialReference:t,extent:i,pixelSize:s}=this.rasterInfo,{pyramidResolutions:n}=e;if(!e.tileInfo){const r=[],o=e.maximumPyramidLevel||0;let l=(s.x+s.y)/2,a=1/.0254*96*l;for(let e=0;e<=o&&(r.unshift(new _.A({level:o-e,resolution:l,scale:a})),e!==o);e++)if(n){const t=(n[e].x+n[e].y)/2;a*=t/l,l=t}else l*=2,a*=2;const c=new f.A({x:i.xmin,y:i.ymax,spatialReference:t});e.tileInfo=new v.A({origin:c,size:[e.blockWidth,e.blockHeight],spatialReference:t,lods:r}),e.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(e,t=512,i=512,s){const{width:n,height:r,nativeExtent:o,pixelSize:l,spatialReference:a}=e,c=new f.A({x:o.xmin,y:o.ymax,spatialReference:a});null==s&&(s=Math.max(0,Math.round(Math.log(Math.max(n,r))/Math.LN2-8)));const u=this.computeBlockBoundary(o,512,512,{x:o.xmin,y:o.ymax},[l],s);e.storageInfo=new b.A({blockWidth:t,blockHeight:i,pyramidBlockWidth:t,pyramidBlockHeight:i,origin:c,firstPyramidLevel:1,maximumPyramidLevel:s,blockBoundary:u})}async computeBestPyramidLevelForLocation(e,t={}){return 0}computeBlockBoundary(e,t,i,s,n,r=0,o=2){if(1===n.length&&r>0){n=[...n];let{x:e,y:t}=n[0];for(let i=0;i<r;i++)e*=o,t*=o,n.push({x:e,y:t})}const l=[],{x:a,y:c}=s;for(let s=0;s<n.length;s++){const{x:r,y:o}=n[s];l.push({minCol:Math.floor((e.xmin-a+.1*r)/t/r),maxCol:Math.floor((e.xmax-a-.1*r)/t/r),minRow:Math.floor((c-e.ymax+.1*o)/i/o),maxRow:Math.floor((c-e.ymin-.1*o)/i/o)})}return l}getPyramidPixelSize(e){const{nativePixelSize:t}=this.rasterInfo,{pyramidResolutions:i,pyramidScalingFactor:s}=this.rasterInfo.storageInfo;if(0===e)return t;if(null!=i&&i.length)return i[e-1];const n=s**e;return{x:t.x*n,y:t.y*n}}identifyPixelLocation(e,t,i,s){const{spatialReference:n,nativeExtent:r,storageInfo:o}=this.rasterInfo,{maximumPyramidLevel:l,origin:a,transposeInfo:c}=o,u=s&&null!=c?c.tileSize[0]:o.blockWidth,h=s&&null!=c?c.tileSize[1]:o.blockHeight,p=(0,I._I)(e,n,i);if(!r.intersects(p))return null;if(t<0||t>l)return null;const d=this.getPyramidPixelSize(t),{x:f,y:m}=d,y=(a.y-p.y)/m/h,g=(p.x-a.x)/f/u,x=Math.min(h-1,Math.floor((y-Math.floor(y))*h)),_=Math.min(u-1,Math.floor((g-Math.floor(g))*u));return{pyramidLevel:t,row:Math.floor(y),col:Math.floor(g),rowOffset:x,colOffset:_,blockWidth:u,srcLocation:p}}getTileExtent(e,t,i,s,n,r){const[o,l]=r,a=s.x+i*o*e.x,c=a+o*e.x,u=s.y-t*l*e.y,h=u-l*e.y;return new d.A({xmin:a,xmax:c,ymin:h,ymax:u,spatialReference:n})}getBlockWidthHeight(e){return{blockWidth:e>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:e>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(e,t,i){const s=this.rasterInfo.storageInfo.blockBoundary[e];return!s||s.maxRow<t||s.maxCol<i||s.minRow>t||s.minCol>i}updateImageSpaceRasterInfo(e){const{pixelSize:t}=e,{width:i,height:s}=e,n=m.A.WebMercator;e.spatialReference=n,e.extent=e.nativeExtent=new d.A({xmin:-.5,ymax:.5,xmax:i-.5,ymin:.5-s,spatialReference:n}),e.isPseudoSpatialReference=!0,e.transform=null,e.pixelSize=new f.A({x:1,y:1,spatialReference:n});const{extent:r,storageInfo:o}=e;if(o){o.origin=new f.A({x:r.xmin,y:r.ymax,spatialReference:n});const{pyramidResolutions:i,tileInfo:s}=o;if(i&&i.forEach((e=>{e.x/=t.x,e.y/=t.y})),s){s.origin=o.origin;const t=(e.nativePixelSize.x+e.nativePixelSize.y)/2;s.lods.forEach(((e,i)=>{e.resolution=t*2**i,e.scale=96*e.resolution/.0254}))}}}async _fetchPixels(e,t,i,s={}){let n=(0,I.OM)(e);if(n>=2)return{extent:e,pixelBlock:null};const r=this._getSourceDataInfo(e,t,i,s),{pyramidLevel:o,srcResolution:l,srcExtent:a,srcWidth:c,srcHeight:u,ul:h}=r;if(0===c||0===u)return{extent:e,srcExtent:a,pixelBlock:null};const{rasterInfo:p}=this,d=p.transform,m="gcs-shift"===d?.type,y=null!=(0,I.FT)(e.spatialReference);!m&&y||(n=(0,I.OM)(r.srcExtent,m));const g=await this._fetchRawTiles(o,h,{width:c,height:u,wrapCount:n},s);if(!g)return{extent:e,srcExtent:a,pixelBlock:null};const x=p.storageInfo,_=o>0?x.pyramidBlockWidth:x.blockWidth,b=o>0?x.pyramidBlockHeight:x.blockHeight;let{x:v,y:w}=p.pixelSize;if(o>0){const{pyramidResolutions:e,pyramidScalingFactor:t}=x;if(null!=e&&e[o-1])({x:v,y:w}=e[o-1]);else{const e=t**o;v*=e,w*=e}}const R=p.spatialReference,S=new f.A({x:v,y:w,spatialReference:R}),M=_===c&&b===u&&h.x%_==0&&h.y%b==0,T=new f.A({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference}),k=!e.spatialReference.equals(R),A=R.isGeographic?1e-9:1e-4,{datumTransformation:P}=s;if(!k&&M&&1===g.pixelBlocks.length&&_===t&&b===i&&function(e,t,i){return Math.abs(e.x-t.x)<i&&Math.abs(e.y-t.y)<i}(l,T,A))return{extent:e,srcExtent:a,srcTilePixelSize:S,pixelBlock:g.pixelBlocks[0]};const F=y&&null!=(0,I.FT)(a.spatialReference)&&this._hasNoneOrGCSShiftTransform,z=s.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");z&&!this.rasterJobHandler&&await(0,I.Hh)();const N=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:g.extent,pixelSize:T.toJSON(),datumTransformation:P,rasterTransform:d,hasWrapAround:n>0||F,isAdaptive:!1!==this.ioConfig.optimizeProjectionAccuracy,includeGCSGrid:z},s):(0,I.l0)({projectedExtent:e,srcBufferExtent:g.extent,pixelSize:T,datumTransformation:P,rasterTransform:d,hasWrapAround:n>0||F,isAdaptive:!1,includeGCSGrid:z});let D;const O=!s.requestRawData,B={rows:N.spacing[0],cols:N.spacing[1]},H=this._hasNoneOrGCSShiftTransform?this._getRasterTileAlignmentInfo(o,g.extent.xmin):void 0,{pixelBlocks:E,mosaicSize:Z,isPartiallyFilled:L}=g;let W=null;if(this.rasterJobHandler){const e=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:E,srcMosaicSize:Z,destDimension:O?{width:t,height:i}:null,coefs:O?N.coefficients:null,sampleSpacing:O?B:null,projectDirections:z,gcsGrid:z?N.gcsGrid:null,isUV:"vector-uv"===this.rasterInfo.dataType,interpolation:s.interpolation,alignmentInfo:H,blockWidths:null},s);({pixelBlock:D,localNorthDirections:W}=e)}else{const e=(0,C.z7)(E,Z,{alignmentInfo:H});D=O?(0,C.$i)(e,{width:t,height:i},N.coefficients,B,s.interpolation):e,z&&N.gcsGrid&&(W=(0,C.QF)({width:t,height:i},N.gcsGrid),D=(0,J.Y2)(D,this.rasterInfo.dataType,W))}return s.requestRawData||z?{extent:e,srcExtent:a,srcTilePixelSize:S,pixelBlock:D,transformGrid:N,localNorthDirections:W,isPartiallyFilled:L}:{extent:e,srcExtent:a,srcTilePixelSize:S,pixelBlock:D}}async _fetchRawTiles(e,t,i,s){const{origin:n,blockBoundary:r}=this.rasterInfo.storageInfo,{blockWidth:o,blockHeight:l}=this.getBlockWidthHeight(e);let{x:a,y:c}=t,{width:u,height:h,wrapCount:p}=i;const f=this._getRasterTileAlignmentInfo(e,0);s.buffer&&(a-=s.buffer.cols,c-=s.buffer.rows,u+=2*s.buffer.cols,h+=2*s.buffer.rows);let m=0,y=0,g=0;p&&null!=f&&(({worldColumnCountFromOrigin:y,originColumnOffset:g,rightPadding:m}=f),y*f.blockWidth-m>=a+u&&(m=0));const x=Math.floor(a/o),_=Math.floor(c/l),b=Math.floor((a+u+m-1)/o),v=Math.floor((c+h+m-1)/l),w=r[e];if(!w)return null;const{minRow:R,minCol:I,maxCol:S,maxRow:M}=w;if(0===p&&(v<R||b<I||_>M||x>S))return null;const T=new Array;let k=!1;const A=null==this.ioConfig.allowPartialFill?s.allowPartialFill:this.ioConfig.allowPartialFill;for(let t=_;t<=v;t++)for(let i=x;i<=b;i++){let n=i;if(!s.disableWrapAround&&p&&null!=f&&y<=i&&(n=i-y-g),t>=R&&n>=I&&M>=t&&S>=n){const i=this._tileFetchQueue.push({pyramidLevel:e,row:t,col:n,options:s},{signal:s.signal});A?T.push(new Promise((e=>{i.then((t=>e(t))).catch((()=>{k=!0,e(null)}))}))):T.push(i)}else T.push(Promise.resolve(null))}if(0===T.length)return null;const P=await Promise.all(T),F={height:(v-_+1)*l,width:(b-x+1)*o},{spatialReference:z}=this.rasterInfo,C=this.getPyramidPixelSize(e),{x:J,y:N}=C;return{extent:new d.A({xmin:n.x+x*o*J,xmax:n.x+(b+1)*o*J,ymin:n.y-(v+1)*l*N,ymax:n.y-_*l*N,spatialReference:z}),pixelBlocks:P,mosaicSize:F,isPartiallyFilled:k}}_fetchRawTile(e,t,i,s){const{storageInfo:n}=this.rasterInfo,r=null!=n.transposeInfo&&!!s.transposedVariableName;if(!r){const s=n.blockBoundary[e];if(!s)return Promise.resolve(null);const{minRow:r,minCol:o,maxCol:l,maxRow:a}=s;if(t<r||i<o||t>a||i>l)return Promise.resolve(null)}const o=function(e,t){return null==t?e:`${e}?sliceId=${t}`}(this.rasterId,r?s.transposeVariableName:s.sliceId),l=`${e}/${t}/${i}`;let c=k(o,s.registryId,l);if(null==c){const n=new AbortController;c=this.fetchRawTile(e,t,i,{...s,signal:n.signal}),A(o,s.registryId,l,c,n),c.catch((()=>P(o,s.registryId,l)))}return s.signal&&(0,a.u7)(s,(()=>{T(o,s.registryId,l)})),c}_computeMagDirValues(e){const{bandCount:t,dataType:i}=this.rasterInfo;if((2!==t||"vector-magdir"!==i)&&"vector-uv"!==i||2!==e?.length||!e[0]?.length)return null;const s=e[0].length;if("vector-magdir"===i){const t=e[1].map((e=>(e+360)%360));return[e[0],t]}const[n,r]=e,o=[],l=[];for(let e=0;e<s;e++){const[t,i]=(0,J.Lu)([n[e],r[e]]);o.push(t),l.push(i)}return[o,l]}_getRasterTileAlignmentInfo(e,t){return null==this._rasterTileAlignmentInfo&&(this._rasterTileAlignmentInfo=(0,I.DO)(this.rasterInfo)),null==this._rasterTileAlignmentInfo.pyramidsInfo?null:{startX:t,halfWorldWidth:this._rasterTileAlignmentInfo.halfWorldWidth,hasGCSSShiftTransform:this._rasterTileAlignmentInfo.hasGCSSShiftTransform,...this._rasterTileAlignmentInfo.pyramidsInfo[e]}}_getSourceDataInfo(e,t,i,s={}){const n={datumTransformation:s.datumTransformation,pyramidLevel:0,pyramidResolution:null,srcExtent:null,srcHeight:0,srcResolution:null,srcWidth:0,ul:{x:0,y:0}};s.srcResolution&&(n.srcResolution=s.srcResolution,this._updateSourceDataInfo(e,n));const r=this.rasterInfo.storageInfo.maximumPyramidLevel||0,{srcWidth:o,srcHeight:l,pyramidLevel:a}=n,c=o/t,u=l/i,h=a<r&&c*u>=16,p=a===r&&this._requireTooManySrcTiles(o,l,t,i);if(h||p||0===o||0===l){const o=new f.A({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference});let l=(0,I.Wo)(o,this.rasterInfo.spatialReference,e,n.datumTransformation);const p=!l||s.srcResolution&&l.x+l.y<s.srcResolution.x+s.srcResolution.y;if(h&&s.srcResolution&&p){const e=Math.round(Math.log(Math.max(c,u))/Math.LN2)-1;if(r-a+3>=e){const t=2**e;l={x:s.srcResolution.x*t,y:s.srcResolution.y*t}}}l&&(n.srcResolution=l,this._updateSourceDataInfo(e,n))}return this._requireTooManySrcTiles(n.srcWidth,n.srcHeight,t,i)&&(n.srcWidth=0,n.srcHeight=0),n}_requireTooManySrcTiles(e,t,i,s){const{tileInfo:n}=this.rasterInfo.storageInfo,r=e/i,o=t/s;return Math.ceil(e/n.size[0])*Math.ceil(t/n.size[1])>=256*Math.max(1,(i+s)/1024)||r>8||o>8}_updateSourceDataInfo(e,t){t.srcWidth=0,t.srcHeight=0;const{rasterInfo:i}=this,s=i.spatialReference,{srcResolution:n,datumTransformation:r}=t,{pyramidLevel:o,pyramidResolution:l,excessiveReading:a}=(0,I.t$)(n,i,this.ioConfig.sampling);if(a)return;let c=t.srcExtent||(0,I._l)(e,s,r);if(null==c)return;const u=i.transform;u&&(c=u.inverseTransform(c)),t.srcExtent=c;const{x:h,y:p}=i.storageInfo.origin,d=Math.floor((c.xmin-h)/l.x+.1),f=Math.floor((p-c.ymax)/l.y+.1),m=Math.floor((c.xmax-h)/l.x-.1),y=Math.floor((p-c.ymin)/l.y-.1),g=c.width<.1*l.x?0:m-d+1,x=c.height<.1*l.y?0:y-f+1;t.pyramidLevel=o,t.pyramidResolution=l,t.srcWidth=g,t.srcHeight=x,t.ul={x:d,y:f}}_getRequestOptionsWithSliceId(e){return null!=this.rasterInfo.multidimensionalInfo&&null==e.sliceId&&(e={...e,sliceId:this.getSliceIndex(e.multidimensionalDefinition)}),e}_processIdentifyResult(e,t){const{srcLocation:i,position:s,pyramidLevel:n,useTransposedTile:r}=t,o=e.pixels[0].length/e.width/e.height;if(e.mask&&!e.mask[s])return{location:i,value:null};const{multidimensionalInfo:l}=this.rasterInfo;if(null==l||!r){const t=e.pixels.map((e=>e[s])),r={location:i,value:t,pyramidLevel:n},o=this._computeMagDirValues(t.map((e=>[e])));return o?.length&&(r.magdirValue=o.map((e=>e[0]))),r}let a=e.pixels.map((e=>e.slice(s*o,s*o+o))),c=this._computeMagDirValues(a);const{requestSomeSlices:u,identifyOptions:h}=t;let p=(0,R.QW)(l,h.transposedVariableName);if(u){const e=(0,R.xx)(p,h.multidimensionalDefinition,h.timeExtent);a=a.map((t=>e.map((e=>t[e])))),c=c?.map((t=>e.map((e=>t[e])))),p=e.map((e=>p[e]))}const d=e.noDataValues||this.rasterInfo.noDataValue,f={pixels:a,pixelType:e.pixelType};let m;return null!=d&&((0,F.Sp)(f,d),m=f.mask),{location:i,value:null,dataSeries:p.map(((e,t)=>{const i={value:0===m?.[t]?null:a.map((e=>e[t])),multidimensionalDefinition:e.multidimensionalDefinition.map((e=>new x.A({...e,isSlice:!0})))};return c?.length&&(i.magdirValue=[c[0][t],c[1][t]]),i})),pyramidLevel:n}}};(0,s._)([(0,u.MZ)()],D.prototype,"_rasterTileAlignmentInfo",void 0),(0,s._)([(0,u.MZ)()],D.prototype,"_tileFetchQueue",void 0),(0,s._)([(0,u.MZ)({readOnly:!0})],D.prototype,"_isGlobalWrappableSource",null),(0,s._)([(0,u.MZ)({readOnly:!0})],D.prototype,"_hasNoneOrGCSShiftTransform",null),(0,s._)([(0,u.MZ)()],D.prototype,"_openPromise",void 0),(0,s._)([(0,u.MZ)()],D.prototype,"rasterJobHandler",null),(0,s._)([(0,u.MZ)({readOnly:!0})],D.prototype,"rasterId",null),(0,s._)([(0,u.MZ)(g.OZ)],D.prototype,"url",null),(0,s._)([(0,u.MZ)({type:String,json:{write:!0}})],D.prototype,"datasetName",void 0),(0,s._)([(0,u.MZ)({type:String,json:{write:!0}})],D.prototype,"datasetFormat",void 0),(0,s._)([(0,u.MZ)()],D.prototype,"hasUniqueSourceStorageInfo",void 0),(0,s._)([(0,u.MZ)()],D.prototype,"rasterInfo",void 0),(0,s._)([(0,u.MZ)()],D.prototype,"ioConfig",void 0),(0,s._)([(0,u.MZ)()],D.prototype,"sourceJSON",void 0),D=(0,s._)([(0,p.$)("esri.layers.support.rasterDatasets.BaseRaster")],D);const O=D},84169:(e,t,i)=>{i.d(t,{A:()=>f});var s=i(90237),n=i(49186),r=i(10107),o=(i(44208),i(53966),i(87811),i(40608)),l=i(39829),a=i(4916),c=i(77359),u=i(28435),h=i(70834),p=i(22671);let d=class extends a.A{constructor(){super(...arguments),this.datasetFormat="Function",this.tileType="Raster",this.rasterFunction=null,this._clippingGeometry=new Map}async fetchPixels(e,t,i,s={}){const{rasters:n,rasterIds:r}=this.primaryRasters;let o=!1;const{interpolation:l}=s,a=this.rasterFunction.flatWebGLFunctionChain?.hasFocalFunction;!s.requestRawData&&a&&(o=1===n.length&&!s.skipRasterFunction,s={...s,interpolation:"bilinear",requestRawData:o});const h=n.map((n=>n.fetchPixels(e,t,i,s))),p=await Promise.all(h),d=p.map((e=>e.pixelBlock)),f=o||s.requestRawData?p.map((e=>e.srcTilePixelSize)):null;if(s.skipRasterFunction||d.every((e=>null==e)))return p[0];const m=p.find((e=>null!=e.pixelBlock))?.extent??e;let y=this.rasterJobHandler?await this.rasterJobHandler.process({extent:m,primaryPixelBlocks:d,primaryPixelSizes:f,primaryRasterIds:r}):this.rasterFunction.process({extent:m,primaryPixelBlocks:d,primaryPixelSizes:f,primaryRasterIds:r});const{transformGrid:g}=p[0];if(!o||null==y||null==g){const e=s.noClip?null:this.getClippingGeometry(m.spatialReference);return s.noClip||s.requestRawData||null==y||!e||(y=await(0,c.$Q)(y,m,e)),{...p[0],pixelBlock:y}}const x={rows:g.spacing[0],cols:g.spacing[1]};let _;_=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[y],srcMosaicSize:{width:y.width,height:y.height},destDimension:{width:t,height:i},coefs:g.coefficients,sampleSpacing:x,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:l,alignmentInfo:void 0,blockWidths:null},s)).pixelBlock:(0,u.$i)(y,{width:t,height:i},g.coefficients,x,l);const b=s.noClip?null:this.getClippingGeometry(e.spatialReference);return s.noClip||s.requestRawData||null==_||null==b||(_=await(0,c.$Q)(_,e,b)),{extent:e,srcExtent:p[0].srcExtent,pixelBlock:_}}getClippingGeometry(e){const t=this._clippingGeometry.get("0");if(!e||!t)return t;const i=function(e){return String(e.wkid??e.wkt??e.wkt2)}(e);let s=this._clippingGeometry.get(i);return null!=s||(s=e.equals(t.spatialReference)?t:(0,h.uk)(t,e),this._clippingGeometry.set(i,s)),s}async _open(e){const{rasterFunction:t}=this;this.primaryRasters?.rasters?.length?t.sourceRasters=this.primaryRasters.rasters:(this.primaryRasters=t.getPrimaryRasters(),this.rasterJobHandler&&this.primaryRasters.rasters?.forEach((e=>e.rasterJobHandler=this.rasterJobHandler)));const{rasters:i,rasterIds:s}=this.primaryRasters,r=i.map((t=>t.rasterInfo?void 0:t.open(e)));await Promise.all(r);const o=i.map((({rasterInfo:e})=>e)),l=t.bind({rasterInfos:o,rasterIds:s});if(t.rawSourceRasterInfos=o,!l.success||0===o.length)throw new n.A("raster-function:open",`cannot bind the function: ${l.error??""}`);const a="Table"===t.functionName?t:t.functionArguments?.raster;"Table"===a?.functionName&&(t.rasterInfo.attributeTable=p.A.fromJSON(a.functionArguments.attributeTableAsRecordSet)),await this.syncJobHandler();const c=o[0];this.hasUniqueSourceStorageInfo=1===o.length||o.slice(1).every((e=>function(e,t){const{storageInfo:i,pixelSize:s,spatialReference:n,extent:r}=e,{storageInfo:o,pixelSize:l,spatialReference:a,extent:c}=t;return s.x===l.x&&s.y===l.y&&n.equals(a)&&r.equals(c)&&i.blockHeight===o.blockHeight&&i.blockWidth===o.blockWidth&&i.maximumPyramidLevel===o.maximumPyramidLevel}(e,c))),this.set("sourceJSON",i[0].sourceJSON),this.set("rasterInfo",t.rasterInfo),await this._updateClipGeometry()}async syncJobHandler(){return this.rasterJobHandler?.updateRasterFunction(this.rasterFunction)}async _updateClipGeometry(){const e=this.rasterFunction.getClippingGeometries()[0];let t=e?.clippingGeometry;if(t&&"inside"===e.clippingType){const{extent:e}=this.rasterInfo,{difference:s,densify:n}=await Promise.all([i.e(9930),i.e(3209)]).then(i.bind(i,33209));let r=n(l.A.fromExtent(e),2*(e.width+e.height)/40);r=(0,h.uk)(r,t.spatialReference),t=s(r,t)}this._clippingGeometry.clear(),t&&this._clippingGeometry.set("0",t)}};(0,s._)([(0,r.MZ)({type:String,json:{write:!0}})],d.prototype,"datasetFormat",void 0),(0,s._)([(0,r.MZ)()],d.prototype,"tileType",void 0),(0,s._)([(0,r.MZ)()],d.prototype,"rasterFunction",void 0),(0,s._)([(0,r.MZ)()],d.prototype,"primaryRasters",void 0),d=(0,s._)([(0,o.$)("esri.layers.support.rasterDatasets.FunctionRaster")],d);const f=d},50103:(e,t,i)=>{function s(e,t){if(!e||!t)return[];let i=t;t.includes("/")?(i=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const n=[];if(t){const r=s(e,i);for(let e=0;e<r.length;e++)s(r[e],t).forEach((e=>n.push(e)));return n}const r=e.getElementsByTagNameNS("*",i);if(!r||0===r.length)return[];for(let e=0;e<r.length;e++)n.push(r[e]||r.item(e));return n}function n(e,t){if(!e||!t)return null;let i=t;t.includes("/")?(i=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const r=s(e,i);return r.length>0?t?n(r[0],t):r[0]:null}function r(e,t=null){const i=t?n(e,t):e;let s;return i?(s=i.textContent||i.nodeValue,s?s.trim():null):null}function o(e,t){const i=s(e,t),n=[];let r;for(let e=0;e<i.length;e++)r=i[e].textContent||i[e].nodeValue,r&&(r=r.trim(),""!==r&&n.push(r));return n}function l(e,t=null){const i=r(e,t);return i?.split(" ").map((e=>Number(e)))??[]}function a(e,t){return o(e,t).map((e=>Number(e)))}function c(e,t){const i=r(e,t);return Number(i)}function u(e,t){const i=e?.nodeName?.toLowerCase(),s=t.toLowerCase();return i.slice(i.lastIndexOf(":")+1)===s}function h(e){return e.nodeName.slice(e.nodeName.lastIndexOf(":")+1)}i.d(t,{Dy:()=>o,IC:()=>s,Ui:()=>a,V6:()=>n,g7:()=>u,mX:()=>r,pN:()=>l,v7:()=>c,vv:()=>h})}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9547],{19547:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Ce});var i=n(90237),s=n(13874),o=n(69540),a=n(49186),r=n(92071),l=n(74887),c=n(36708),u=n(10107),p=(n(44208),n(53966)),d=(n(87811),n(40608)),m=n(4146),f=n(63074),g=n(69208),h=n(89015),v=n(16131),y=n(8303),b=n(54310),w=n(25036),x=n(82935),C=n(10873),I=n(20437),S=n(74797),D=n(5443),A=n(38458),T=n(78888),L=n(50103);function V(e){return e.endsWith("?")?e.slice(0,-1):e}function M(e){return e.filter((({coverageSubType:e})=>null==e||""===e||/^rectified(grid|dataset)/i.test(e)))}function N(e){const t={};for(let n=0;n<e.childNodes.length;n++){const i=e.childNodes[n];if(1!==i.nodeType)continue;const s=(0,L.vv)(i).toLowerCase();switch(s){case"title":case"abstract":t[s]=(0,L.mX)(i);break;case"identifier":t.id=(0,L.mX)(i);break;case"wgs84boundingbox":{const e=(0,L.pN)(i,"LowerCorner"),n=(0,L.pN)(i,"UpperCorner");t.lonLatEnvelope=new D.A({xmin:e[0],ymin:e[1],xmax:n[0],ymax:n[1],spatialReference:{wkid:4326}})}break;case"coveragesummary":t.coverageSummaries=t.coverageSummaries||[],t.coverageSummaries.push(N(i))}}return t}function R(e,t){if(e.coverageSummaries)for(let n=0;n<e.coverageSummaries.length;n++)e.coverageSummaries[n].abstract=e.coverageSummaries[n].abstract||e.abstract,e.coverageSummaries[n].lonLatEnvelope=e.coverageSummaries[n].lonLatEnvelope||e.lonLatEnvelope,e.coverageSummaries[n].title=e.coverageSummaries[n].title||e.title,R(e.coverageSummaries[n],t);null!=e.id&&t.push(e)}function P(e){const t=(0,L.V6)(e.querySelector("Operation[name=GetCapabilities]"),"Get")?.getAttribute("xlink:href")||"",n=(0,L.V6)(e.querySelector("Operation[name=DescribeCoverage]"),"Get")?.getAttribute("xlink:href")||"",i=(0,L.V6)(e.querySelector("Operation[name=GetCoverage]"),"Get")?.getAttribute("xlink:href")||"";return{getCapabilities:V(t),describeCoverage:V(n),getCoverage:V(i)}}function E(e,t=null){let n=null;n="string"==typeof e?(new DOMParser).parseFromString(e,"text/xml"):e;let i=n.documentElement.getAttribute("version");"1.0"===i?i="1.0.0":"1.1"===i&&(i="1.1.0");const s=i||t||"1.0.0",o=s.slice(0,3);let r;if("2.0"===o)r=function(e){const t=(0,L.V6)(e,"ServiceIdentification"),n=(0,L.mX)(t,"Title"),i=(0,L.Dy)(t,"ServiceTypeVersion"),s=(0,L.Dy)(t,"Profile"),o=P((0,L.V6)(e,"OperationsMetadata")),a=(0,L.IC)(e,"Contents/CoverageSummary"),r=[];for(let e=0;e<a.length;e++){const t=a[e],n=(0,L.mX)(t,"CoverageId"),i=(0,L.V6)(t,"WGS84BoundingBox");let s;if(i){const e=(0,L.pN)(i,"LowerCorner"),t=(0,L.pN)(i,"UpperCorner");s=new D.A({xmin:e[0],ymin:e[1],xmax:t[0],ymax:t[1],spatialReference:{wkid:4326}})}const o=(0,L.mX)(t,"CoverageSubtype")||"RectifiedGridCoverage";r.push({id:n,lonLatEnvelope:s,coverageSubType:o})}const l=(0,L.V6)(e,"ServiceMetadata");return{name:n,supportedVersions:i,supportedFormats:(0,L.Dy)(l,"formatSupported"),supportedInterpolations:(0,L.Dy)(l,"interpolationSupported").concat((0,L.Dy)(l,"InterpolationSupported")),onlineResources:o,profiles:s,coverages:r,gridCoverages:M(r),version:"2.0.1"}}(n);else if("1.1"===o)r=function(e){const t=(0,L.mX)(e,"ServiceIdentification/Title"),n=(0,L.Dy)(e,"ServiceIdentification/ServiceTypeVersion"),i=P((0,L.V6)(e,"OperationsMetadata")),s=[],o=(0,L.V6)(e,"Contents");for(let e=0;e<o.childNodes.length;e++){const t=o.childNodes[e];1===t.nodeType&&(0,L.g7)(t,"CoverageSummary")&&R(N(t),s)}const a=(0,L.Dy)(o,"SupportedFormat");return{name:t,onlineResources:i,coverages:s,gridCoverages:M(s),supportedVersions:n,supportedFormats:a,version:"1.1.0"}}(n);else{if("1.0"!==o)throw new a.A("wcsraster:parsecapabilities","the capabilities version is not supported");r=function(e){const t=(0,L.mX)(e,"Service/name"),n=(0,L.V6)(e,"Capability"),i=(0,L.V6)(n,"GetCapabilities/Get/OnlineResource")?.getAttribute("xlink:href")??"",s=(0,L.V6)(n,"DescribeCoverage/Get/OnlineResource")?.getAttribute("xlink:href")??"",o=(0,L.V6)(n,"GetCoverage/Get/OnlineResource")?.getAttribute("xlink:href")??"",a={getCapabilities:V(i),describeCoverage:V(s),getCoverage:V(o)},r=(0,L.IC)(e,"CoverageOfferingBrief"),l=[];for(let e=0;e<r.length;e++){const t=r[e],n=(0,L.mX)(t,"name"),i=(0,L.IC)(t,"pos"),s=(0,L.pN)(i[0]),o=(0,L.pN)(i[1]),a=new D.A({xmin:s[0],ymin:s[1],xmax:o[0],ymax:o[1],spatialReference:{wkid:4326}});l.push({id:n,lonLatEnvelope:a})}return{name:t,onlineResources:a,coverages:l,gridCoverages:M(l),supportedVersions:["1.0.0"],version:"1.0.0"}}(n)}return r.version=s,r}var $=n(39829),O=n(87186),X=n(77301);function _(e){e.variables.forEach((e=>e.dimensions.forEach((e=>e.values??=(0,X.Xg)(e)))))}function k(e){return{requestResponseCRSs:(0,L.Dy)(e,"requestResponseCRSs").map((e=>e.split(":")[1])),nativeCRSs:(0,L.Dy)(e,"nativeCRSs").map((e=>e.split(":")[1]))}}function F(e,t){const n=(0,L.Dy)(e,"1.0.0"===t?"interpolationMethod":"InterpolationMethod"),i="1.0.0"===t?e.getAttribute("default"):(0,L.mX)(e,"InterpolationMethods/Default");return null!=i?[i].concat(n.filter((e=>e.toLowerCase()!==i.toLowerCase()))):n}function G(e){return null==e?["nearest"]:e.map((e=>{const t=e.toLowerCase();return t.includes("nearest")?"nearest":t.includes("linear")?"bilinear":t.includes("cubic")?"cubic":null})).filter((e=>!!e))}function B(e){const t=(0,L.IC)(e,"pos"),n=(0,L.pN)(t[0]),i=(0,L.pN)(t[1]);return new D.A({xmin:n[0],ymin:n[1],xmax:i[0],ymax:i[1],spatialReference:{wkid:4326}})}function j(e,t){const n=(0,L.Dy)(e,t);return n?.length&&""!==n[0]&&!isNaN(Number(n[0]))?n.map((e=>Number(e))):null}function W(e){const t=(0,L.pN)(e,"MinimumValue"),n=(0,L.pN)(e,"MaximumValue");return t.length&&n.length?t.map(((e,t)=>({min:e,max:n[t],avg:-1,stddev:-1}))):null}function q(e){return null==e?null:e.every((t=>t===e[0]))?e[0]:e}function Z(e){const t=[],n=(0,L.IC)(e,"RangeSet");let i=[];for(let e=0;e<n.length;e++){const s=(0,L.mX)(n[e],"name"),o=(0,L.mX)(n[e],"label"),a=[],r=j(n[e],"nullValues/singleValue"),l=(0,L.IC)(n[e],"AxisDescription");for(let e=0;e<l.length;e++){const t=(0,L.mX)(l[e],"name"),n=(0,L.mX)(l[e],"label"),s=(0,L.Dy)(l[e],"singleValue");if(0===s.length){const t=(0,L.mX)(l[e],"min"),n=(0,L.mX)(l[e],"max"),i=Number((0,L.mX)(l[e],"res"))||1;if(null!==t&&null!==n)for(let e=parseInt(t,10);e<=parseInt(n,10);e+=i)s.push(e.toString())}"band"===t.toLowerCase()&&(i=s),a.push({name:t,label:n,values:s})}t.push({name:s,label:o,nullValues:r,axis:a})}return{rangeSet:t,bandNames:i}}function U(e=null){if(!e)return{resolution:null,units:null};let t=e.toUpperCase();const n=["Years","Months","Days","Hours","Minutes","Seconds"];let i,s,o;return t.includes("PT")?(t=t.slice(2),o=["H","M","S"].findIndex((e=>t.includes(e))),i=n[3+o],s=parseFloat(t.slice(0,-1))):(t=t.slice(1),o=["Y","M","D"].findIndex((e=>t.includes(e))),o>-1&&(i=n[o]),s=parseFloat(t.slice(0,-1))),{resolution:s,units:i}}function z(e){const t=(0,L.IC)(e,"timeposition");if(t.length>0){const e=[];for(let n=0;n<t.length;n++)e.push(new Date((0,L.mX)(t[n])));return{begin:e[0],end:e[e.length-1],values:e}}const n=(0,L.V6)(e,"timePeriod")||(0,L.V6)(e,"TimePeriod");return n?{begin:new Date((0,L.mX)(n,"beginPosition")||(0,L.mX)(n,"BeginPosition")),end:new Date((0,L.mX)(n,"endPosition")||(0,L.mX)(n,"EndPosition")),...U((0,L.mX)(n,"timeResolution")||(0,L.mX)(n,"TimeResolution"))}:null}function H(e){const t=(0,L.V6)(e,"spatialDomain"),n=(0,L.V6)(t,"Envelope")||(0,L.V6)(t,"EnvelopeWithTimePeriod"),i=n.getAttribute("srsName").split(":"),s=i[i.length-1],o=(0,L.IC)(n,"pos"),a=(0,L.pN)(o[0]),r=(0,L.pN)(o[1]),l=parseInt(s,10),c=isNaN(l)?null:{wkid:l},u=new D.A({xmin:a[0],ymin:a[1],xmax:r[0],ymax:r[1],spatialReference:c}),p=(0,L.V6)(t,"RectifiedGrid"),d=(0,L.mX)(p,"low").split(" "),m=(0,L.mX)(p,"high").split(" "),f=parseInt(m[0],10)-parseInt(d[0],10)+1,g=parseInt(m[1],10)-parseInt(d[1],10)+1,h=(0,L.pN)(t,"origin/pos"),v=(0,L.IC)(t,"offsetVector"),y={envelope:u,columns:f,rows:g,offset:{x:parseFloat((0,L.mX)(v[0]).split(" ")[0]),y:parseFloat((0,L.mX)(v[1]).split(" ")[1])},origin:{x:h[0],y:h[1]}},b=(0,L.V6)(e,"temporalDomain")||(0,L.V6)(e,"TemporalDomain");return{spatialDomain:y,temporalDomain:b?z(b):null}}function Y(e,t){const n=[],i=(0,L.IC)(e,"Field");let s,o=[];for(let e=0;e<i.length;e++){const a=(0,L.mX)(i[e],"Identifier"),r=(0,L.mX)(i[e],"Description"),l=(0,L.mX)(i[e],"Definition"),c=(0,L.mX)(i[e],"Abstract"),u=(0,L.mX)(i[e],"Title"),p=j(i[e],"NullValue"),d=(0,L.V6)(i[e],"AllowedValues"),m=d?W(d):null,f=F(i[e],"1.1.0"),g=[],h=(0,L.IC)(i[e],"Axis");for(let e=0;e<h.length;e++){const n=h[e].getAttribute("identifier"),i=(0,L.mX)(h[e],"UOM"),a=(0,L.mX)(h[e],"DataType"),r=(0,L.Dy)(h[e],"Key");t&&!n.toLowerCase().includes("band")||(o=r,s=p),g.push({identifier:n,uom:i,dataType:a,values:r,bandNoDataValues:s})}n.push({identifier:a,description:r,definition:l,abstract:c,title:u,supportedInterpolations:f,axis:g,nullValues:p,statistics:m})}return{rangeSet:n,bandNames:o,bandNoDataValues:s,statistics:n[0].statistics}}function Q(e){const t=(0,L.V6)(e,"SpatialDomain"),n=(0,L.V6)(t,"GridCRS"),i=(0,L.mX)(n,"GridBaseCRS"),s=(0,L.mX)(n,"GridOrigin"),o=s?.split(" ").map((e=>parseFloat(e)))??[0,0],a=(0,L.pN)(n,"GridOffsets"),r=(0,L.IC)(t,"BoundingBox");let l,c,u,p;for(let e=0;e<r.length;e++){const t=r[e].getAttribute("crs")?.toLowerCase();if(null!=t)if(t.includes("imagecrs")){const t=(0,L.pN)(r[e],"LowerCorner"),n=(0,L.pN)(r[e],"UpperCorner");l=n[0]-t[0]+1,c=n[1]-t[1]+1}else if(t.indexOf("epsg")>0){const n=t.split(":");u=parseInt(n[n.length-1],10);const i=(0,L.pN)(r[e],"LowerCorner"),s=(0,L.pN)(r[e],"UpperCorner");p=new D.A({xmin:i[0],ymin:i[1],xmax:s[0],ymax:s[1],spatialReference:{wkid:u}})}}const d=l>c,m=p.xmax-p.xmin>p.ymax-p.ymin;let f=!1;(0,A.m)(u)&&(d===m?f=!1:(f=!0,p=new D.A({xmin:p.ymin,ymin:p.xmin,xmax:p.ymax,ymax:p.xmax,spatialReference:{wkid:u}})));const g={columns:l,rows:c,origin:{x:o[0],y:o[1]},offset:{x:a[0],y:a[a.length-1]},gridBaseCRS:i,envelope:p,useEPSGAxis:f},h=(0,L.V6)(e,"temporalDomain")||(0,L.V6)(e,"TemporalDomain");return{spatialDomain:g,temporalDomain:h?z(h):null}}function J(e){const t=(0,L.V6)(e,"Envelope")||(0,L.V6)(e,"EnvelopeWithTimePeriod"),n=t.getAttribute("srsName"),i=n.slice(n.lastIndexOf("/")+1),s=t.getAttribute("axisLabels").split(" ").map((e=>e.trim())).filter((e=>""!==e.trim())),o=(0,L.pN)(t,"lowerCorner"),a=(0,L.pN)(t,"upperCorner"),r=!["y","lat","latitude","north","nor","n","b"].includes(s[0].toLowerCase());let l;const c=parseInt(i,10),u=isNaN(c)?null:{wkid:c};l=new D.A(r?{xmin:o[0],ymin:o[1],xmax:a[0],ymax:a[1],spatialReference:u}:{xmin:o[1],ymin:o[0],xmax:a[1],ymax:a[0],spatialReference:u});const p={mins:o,maxs:a},d=t.getAttribute("uomLabels").trim().split(" ");let m,f;if((0,L.g7)(t,"EnvelopeWithTimePeriod")){m=new Date((0,L.mX)(e,"beginPosition")||(0,L.mX)(e,"BeginPosition")),f=new Date((0,L.mX)(e,"endPosition")||(0,L.mX)(e,"EndPosition"));const t=d?.findIndex((e=>"oledatetime"===e?.toLowerCase()));t>-1&&(d[t]="ISO8601")}return{envelope:l,axisLabels:s,uomLabels:d.length?d:null,envelopeAllDims:p,beginPosition:m,endPosition:f,isEastFirst:r}}function K(e,t){const n=[],i=(0,L.IC)(e,"DataRecord"),s=[];let o,a=[];for(let e=0;e<i.length;e++){const r=(0,L.IC)(i[e],"field"),l=[];for(let e=0;e<r.length;e++){const n=r[e].getAttribute("name"),i=(0,L.mX)(r[e],"description")||"",c=(0,L.V6)(r[e],"uom")?.getAttribute("code")||"",u=(0,L.pN)(r[e],"interval"),p=j(r[e],"nilValue")?.[0];t&&!n.toLowerCase().includes("band")||(s.push(n),u?.length&&(o=o||[],o.push({min:u[0],max:u[1],avg:-1,stddev:-1})),a.push(p)),l.push({name:n,description:i,uom:c,allowedValues:u,nilValue:p})}n.push(l)}return a.some((e=>null!=e))||(a=null),{rangeType:n,bandNames:s,bandStats:o,bandNoDataValues:a}}function ee(e){let t=1,n="";const i=.01;return Math.abs(e-1/24)<1/24*i?n="Hours":Math.abs(e-1)<1*i?n="Days":e<1?(t=Math.round(24*e),n="Hours"):e>28-i&&e<31+i||Math.round(e/30)<12?n="Months":e>365-i&&e<366+i&&(n="Years"),{interval:t,intervalUnit:n}}function te(e,t){const n=(0,L.V6)(e,"RectifiedGrid"),i=(0,L.pN)(n,"low"),s=(0,L.pN)(n,"high"),o=[];for(let e=0;e<i.length;e++)o.push(s[e]-i[e]+1);const a=(0,L.mX)(n,"axisLabels").split(" "),r=(0,L.pN)(n,"origin/pos"),l=(0,L.IC)(n,"offsetVector"),c=[];for(let e=0;e<l.length;e++){const t=(0,L.pN)(l[e]),n=t.findIndex((e=>0!==e));c[n]=t[n]}let u,p,d,m=!1;return t?.length&&a?.length&&(m=[...t].sort(((e,t)=>e<t?-1:1)).join(",")===[...a].sort(((e,t)=>e<t?-1:1)).join(",")),["y","lat","latitude","north","nor","n","b"].includes((m?a:t)[0].toLowerCase())?(u=o[1],p=o[0],d={y:Math.abs(c[0]),x:Math.abs(c[1])}):(u=o[0],p=o[1],d={x:Math.abs(c[0]),y:Math.abs(c[1])}),{columns:u,rows:p,origin:r,offset:c,resolution:d,gridSamples:o,axisLabels:a,hasSameAxisLabelsAsBoundedBy:m}}function ne(e){const t=(0,L.V6)(e,"EarthObservation");if(!t)return null;const n=(0,L.V6)(t,"phenomenonTime"),i=n?z(n):null,s=(0,L.V6)(t,"phenomenonTime"),o=s?z(s):null,a=(0,L.mX)(t,"featureOfInterest/Footprint/multiExtentOf/MultiSurface/surfaceMembers/Polygon/exterior/LinearRing/posList");let r=null;if(a){const e=a.split(" ").map((e=>e.trim())).filter((e=>null!=e&&""!==e)).map(Number);if(e.length){const t=[];for(let n=0;n<e.length/2;n+=2)t.push(e[n],e[n+1]);r=new $.A({rings:[[t]]})}}return{observation:{phenomenonTime:i,resultTime:o,footprint:r,identifier:(0,L.mX)(e,"metaDataProperty/EarthObservationMetaData/identifier"),acquisitionType:(0,L.mX)(e,"metaDataProperty/EarthObservationMetaData/acquisitionType"),status:(0,L.mX)(e,"metaDataProperty/EarthObservationMetaData/status")}}}async function ie(e,t){const{coverageIds:n,version:i,customParameters:s,signal:o}=t,r=i.slice(0,3),c="1.0"===r?"coverage":"1.1"===r?"identifiers":"coverageId",u={service:"WCS",request:"DescribeCoverage",version:i,[c]:n.join(","),...s};try{const{data:t}=await(0,T.A)(e,{query:u,responseType:"xml",signal:o});return function(e,t){let n=null;if(n="string"==typeof e?(new DOMParser).parseFromString(e,"text/xml"):e,"1.0.0"===t)return(0,L.IC)(n,"CoverageOffering").map((e=>function(e){const t={version:"1.0"};let n,i=[];for(let s=0;s<e.childNodes.length;s++){const o=e.childNodes[s];if(1===o.nodeType)if((0,L.g7)(o,"description"))t.description=(0,L.mX)(o);else if((0,L.g7)(o,"name"))t.name=(0,L.mX)(o);else if((0,L.g7)(o,"label"))t.label=(0,L.mX)(o);else if((0,L.g7)(o,"supportedFormats"))t.supportedFormats=(0,L.Dy)(o,"formats");else if((0,L.g7)(o,"supportedCRSs"))t.supportedCRSs=k(o);else if((0,L.g7)(o,"supportedInterpolations"))t.supportedInterpolations=F(o,"1.0.0");else if((0,L.g7)(o,"lonLatEnvelope"))t.lonLatEnvelope=B(o);else if((0,L.g7)(o,"rangeSet")){const e=Z(o);t.rangeSet=e.rangeSet,i=e.bandNames;const s=e.rangeSet[0].nullValues;s?.length&&(n=q(s))}else(0,L.g7)(o,"domainSet")&&(t.domainSet=H(o))}const s=G(t.supportedInterpolations),{name:o,description:a,label:r,lonLatEnvelope:l,supportedFormats:c}=t,{spatialDomain:u}=t.domainSet,p={x:Math.abs(u.offset.x),y:Math.abs(u.offset.y)},d=function(e){if(!e.temporalDomain)return null;const{begin:t,end:n,values:i,units:s,resolution:o}=e.temporalDomain,a={variables:[{name:"default",description:"",dimensions:[{name:"StdTime",description:"",unit:"ISO8601",values:i?.map((e=>e.getTime())),hasRegularIntervals:!i,interval:o,intervalUnit:s,extent:[t.getTime(),n.getTime()]}]}]};return _(a),a}(t.domainSet),m=new O.A({width:u.columns,height:u.rows,pixelSize:p,pixelType:"unknown",extent:u.envelope,spatialReference:u.envelope.spatialReference,bandCount:i.length||1,noDataValue:n,multidimensionalInfo:d});return{id:o,title:t.name,description:a||r,lonLatEnvelope:l,rasterInfo:m,bandNames:i,supportedFormats:c,supportedInterpolations:s,coverageDescription:t,version:"1.0.0",useEPSGAxis:!1}}(e)));const i=(0,L.IC)(n,"CoverageDescription");return"1.1.0"===t||"1.1.1"===t||"1.1.2"===t?i.map((e=>function(e,t){const n=[],i=[],s={supportedFormats:n,supportedCRSs:i,version:"1.1"};let o,a,r=[];for(let t=0;t<e.childNodes.length;t++){const l=e.childNodes[t];if(1!==l.nodeType)continue;const c=(0,L.vv)(l).toLowerCase();switch(c){case"title":case"abstract":case"identifier":s[c]=(0,L.mX)(l);break;case"supportedformat":{const e=(0,L.mX)(l);n.includes(e)||n.push(e)}break;case"supportedcrs":{const e=(0,L.mX)(l);i.includes(e)||i.push(e)}break;case"range":{const e=Y(l,!!s.domain?.temporalDomain);s.range=e.rangeSet,r=e.bandNames;const{bandNoDataValues:t}=e;t?.length&&(o=q(t)),a=e.statistics}break;case"domain":s.domain=Q(l)}}const l=G(s.range[0].supportedInterpolations),{identifier:c,abstract:u,title:p,domain:d,range:m}=s,f={x:Math.abs(d.spatialDomain.offset.x),y:Math.abs(d.spatialDomain.offset.y)},g=function(e,t){if(!t.temporalDomain)return null;const n=e.filter((e=>!e.identifier.toLowerCase().includes("field_1")&&!e.axis.some((e=>e.identifier.includes("band"))))),i=[];if(n.length&&n.forEach((e=>{const t=e.axis.map((e=>{const t=e.values.map((t=>"ISO8601"===e.uom?(t=t.trim()).toLowerCase().includes("z")?new Date(t).getTime():new Date(t+"Z").getTime():parseFloat(t.trim()))),n=[Math.min.apply(null,t),Math.max.apply(null,t)];return{name:e.identifier.trim(),description:"",field:e.identifier.trim(),unit:e.uom?e.uom.trim():"",hasRegularIntervals:!1,values:t,extent:n}}));i.push({name:e.identifier.trim(),description:e.description?.trim()??"",unit:"",dimensions:t,statistics:e.statistics})})),t.temporalDomain){const{begin:e,end:n,values:s,units:o,resolution:a}=t.temporalDomain;i.some((e=>e.dimensions.some((e=>"stdtime"===e.name.toLowerCase()))))||i.forEach((t=>{t.dimensions.push({name:"StdTime",description:"",unit:"ISO8601",values:s?.map((e=>e.getTime())),hasRegularIntervals:!s,interval:a,intervalUnit:o,extent:[e.getTime(),n.getTime()]})}))}if(i.length){const e={variables:i};return _(e),e}return null}(m,d);g&&(o=m[0].nullValues,1===o?.length&&(o=o[0]));const h=new O.A({width:d.spatialDomain.columns,height:d.spatialDomain.rows,pixelSize:f,pixelType:"unknown",extent:d.spatialDomain.envelope,spatialReference:d.spatialDomain.envelope.spatialReference,bandCount:r.length||1,noDataValue:o,statistics:a,multidimensionalInfo:g});return{id:c,title:s.title,description:u||p,bandNames:r,rasterInfo:h,supportedFormats:n,supportedInterpolations:l,coverageDescription:s,version:t,useEPSGAxis:d.spatialDomain.useEPSGAxis}}(e,t))):i.map((e=>function(e){const t={version:"2.0"};let n,i,s=[];for(let o=0;o<e.childNodes.length;o++){const a=e.childNodes[o];if(1===a.nodeType)if((0,L.g7)(a,"coverageId"))t.coverageId=(0,L.mX)(a);else if((0,L.g7)(a,"ServiceParameters"))t.serviceParameters={supportedFormats:(0,L.Dy)(a,"nativeFormat")};else if((0,L.g7)(a,"boundedBy"))t.boundedBy=J(a);else if((0,L.g7)(a,"rangeType")){const e=K(a,t.boundedBy?.axisLabels.length>2||t.domainSet?.axisLabels.length>2);t.rangeType=e.rangeType,s=e.bandNames,n=e.bandStats;const{bandNoDataValues:o}=e;o?.length&&(i=q(o))}else if((0,L.g7)(a,"domainSet"))t.domainSet=te(a,t.boundedBy?.axisLabels);else if((0,L.g7)(a,"metadata")){const e=(0,L.V6)(a,"EOMetadata");t.eoMetadata=e?ne(e):null}}const{coverageId:o,boundedBy:a,domainSet:r,rangeType:l,serviceParameters:c}=t,u=function(e,t,n){if(n.axisLabels.length<=2)return null;const i=[];for(let t=0;t<e.length;t++){const n=e[t];for(let e=0;e<n.length;e++)n[e].name.toLowerCase().includes("band")||i.push(n[e])}const s=[];if(i.length){const e=[];for(let i=2;i<n.axisLabels.length;i++){const s=t.uomLabels?.[i]?.trim()??"",o=n.axisLabels[i].toLowerCase().includes("time")||"iso8601"===s.toLowerCase()||"oledatetime"===s.toLowerCase();let a,r;if(o){const e=ee(n.offset[i]);a=e.interval,r=e.intervalUnit}else a=n.offset[i],r=s;const l=[];o?(l.push((0,X.$E)(t.envelopeAllDims.mins[i])),l.push((0,X.$E)(t.envelopeAllDims.maxs[i]))):(l.push(t.envelopeAllDims.mins[i]),l.push(t.envelopeAllDims.maxs[i])),e.push({name:n.axisLabels[i].trim(),description:n.axisLabels[i].trim(),unit:o?"ISO8601":s,hasRegularIntervals:!0,extent:l,interval:a,intervalUnit:r})}if(i.forEach((t=>{const{allowedValues:n}=t,i=2===n?.length?[{min:n[0],max:n[1],avg:-1,stddev:-1}]:null;s.push({name:t.name.trim(),description:t.description?.trim()??"",unit:t.uom.trim(),statistics:i,dimensions:[...e]})})),s.length){const e={variables:s};return _(e),e}}return null}(l,a,r);return!n&&u&&(n=u?.variables[0].statistics),null!=u&&(i=l[0][0].nilValue),{id:o,title:o,description:o,bandNames:s,rasterInfo:new O.A({width:r.columns,height:r.rows,pixelSize:r.resolution,pixelType:"unknown",extent:a.envelope,spatialReference:a.envelope.spatialReference,bandCount:s.length||1,statistics:n,noDataValue:i,multidimensionalInfo:u}),supportedFormats:c.supportedFormats,coverageDescription:t,version:"2.0.1",useEPSGAxis:!1}}(e)))}(t,i)}catch(e){if(!(0,l.zf)(e))throw new a.A("wcslayer:open","wcs coverage description is not valid or supported");throw e}}var se=n(45617),oe=n(4916);function ae(e){const t=function(e){const t=e.getHeader?.("Content-Type")?.split(";");if(!t)return null;if(!(t[0].trim()??"").startsWith("multipart/"))return null;const n={boundary:"",start:"",type:""};for(let e=1;e<t.length;e++){const i=t[e].indexOf("=");if(i>0){const s=t[e].slice(0,i).trim(),o=t[e].slice(i+1).trim();n[s]=o.startsWith('"')?o.slice(1,-1):o}}return n}(e);return t?{isMultipart:!0,data:t.boundary?re(e.data,t,0):null}:{isMultipart:!1,data:null}}function re(e,t,n=0){const i="--"+t.boundary,s=[];for(let e=0;e<i.length;e++)s.push(i.charCodeAt(e));const o=[],a="\n--"+t.boundary+"--";for(let e=0;e<a.length;e++)o.push(a.charCodeAt(e));const r=[10],l=[13,10],c=[],u=s.length,p=new Uint8Array(e,n),d=p.length-u;let m=0,f=0;for(let e=0;e<d;e++){for(f=0;f<u&&p[e+f]===s[f];f++);if(f!==u)continue;let n=!1;if(m){const i=le(p.subarray(m,e),t);c.push(i),n=!!i.isValidImage}if(e+=u-1,p[e+1]===r[0]?e+=1:p[e+1]===l[0]&&p[e+2]===l[1]&&(e+=2),m=e+1,n)break}const g=o.length;for(let e=p.length-g-10;e<p.length-g;e++){for(f=0;f<g&&p[e+f]===o[f];f++);if(f===g){c.push(le(p.subarray(m,e),t));break}}return c}function le(e,t){const n=String.fromCharCode.apply(null,e.subarray(0,Math.min(300,e.length))).split("\n"),i=Math.min(n.length,7),s={contentDisposition:"inline"};let o=0;for(let a=0;a<i;a++)if(n[a].length<4)o=o+n[a].length+1;else if("content"===n[a].slice(0,7).toLowerCase()){o=o+n[a].length+1;const e=n[a].indexOf(":");if(-1===e)continue;const t=n[a].slice(0,e).trim(),i=n[a].slice(e+1).trim();switch(t.toLowerCase()){case"content-type":s.contentType=i;break;case"content-description":s.contentDescription=i;break;case"content-transfer-encoding":s.contentTransferEncoding=i;break;case"content-id":s.contentID=i;break;case"content-disposition":s.contentDisposition=i;break;case"content-location":s.contentLocation=i}}else{if(s.contentDisposition.toLowerCase().includes("inline")&&n[a].length>=4&&s.contentType?.toLowerCase().indexOf("image")>-1){let t=!0,n=e.subarray(o,e.length);if(s.contentType.toLowerCase().indexOf("tif")>0){if("base64"===s.contentTransferEncoding){let e="";const t=n;for(let n=0;n<t.length;n+=65535){const i=t.subarray(n,n+65535>t.length-1?t.length-1:n+65535);e+=String.fromCharCode.apply(null,i)}const i=atob(e);n=new Uint8Array(i.length);for(let e=0;e<n.length;e++)n[e]=i.charCodeAt(e)}t=73===n[0]&&73===n[1]||77===n[0]&&77===n[1]}if(t){let t=n.buffer;"base64"!==s.contentTransferEncoding&&(t=new ArrayBuffer(e.length-o),n=new Uint8Array(t),n.set(e.subarray(o,e.length))),s.contentData=t,s.isValidImage=!0}break}if((""===t.start||s.contentID===t.start)&&s.contentType){if(s.contentType.includes("text")||s.contentType.includes("xml")){s.contentData=String.fromCharCode.apply(null,e.subarray(o,e.length));break}s.contentData=e.subarray(o,e.length)}}return s}var ce=n(51244),ue=n(28435);const pe=["nearest neighbor","bilinear","bicubic"],de=["nearest","linear","cubic"],me="response is not a supported multipart/related mediaType with inline tiff, switching to compatibility mode",fe=new Set(["1.0.0","1.1.0","1.1.1","1.1.2","2.0.1"]);let ge=class extends oe.A{constructor(){super(...arguments),this.datasetFormat="WCSServer",this.tileType="Raster"}get rasterId(){return`${this.url}-${this.coverageId}-${this.version}`}async fetchRawTile(e,t,n,i={}){if(this.isBlockOutside(e,t,n))return null;const{nativePixelSize:s,spatialReference:o}=this.rasterInfo,r=2**e,l=s.x*r,c=s.y*r,{blockWidth:u,blockHeight:p}=this.getBlockWidthHeight(e),{origin:d}=this.rasterInfo.storageInfo.tileInfo,m=this.getTileExtent({x:l,y:c},t,n,d,o,[u,p]),f=this.rasterInfo.extent,g=m.xmax>f.xmax,h=m.ymin<f.ymin,v=g||h;let y=m,b=u,w=p;if(v&&(y=m.clone().intersection(f),null!=y&&(g&&(b=Math.floor((y.xmax-y.xmin)/l),y.xmax=y.xmin+l*b),h&&(w=Math.floor((y.ymax-y.ymin)/c),y.ymin=y.ymax-c*w))),null==y||b<=1||w<=1)return null;const x=await this._getCoverage(y,b,w,r,i);if(!x)return null;const{coverageDescription:C}=this.coverageInfo,{noDataValue:I,multidimensionalInfo:S}=this.rasterInfo,{multidimensionalDefinition:D}=i;let A;if(null!=S&&null!=D&&D.length){const e=D[0].variableName;if("2.0"===C.version){const t=C.rangeType[0].find((t=>t.name===e));A=t?.nilValue}else if("1.1"===C.version){const t=C.range.find((t=>t.identifier===e));A=t?.nullValues}}const T=A??I,L=await this.decodePixelBlock(x,{width:b,height:w,planes:null,pixelType:null,tiffNoDataValue:Array.isArray(T)?T[0]:T,matchAllNoData:!0});if(null==L)return null;if(L&&(L.width!==b||L.height!==w))throw new a.A("wcsraster-fetch",`the response has unexpected dimension width: ${L.width}, height: {pixelBlock.height}`);return v?(0,ue.$Q)(L,{x:0,y:0},{width:p,height:p}):L}async _open(e){const{customFetchParameters:t}=this.ioConfig,n=e?.signal,i=await async function(e,t){const{version:n,customParameters:i,signal:s}=t??{},o=n?.startsWith("1.0")?"version":"acceptVersions",r={service:"WCS",request:"GetCapabilities",[o]:n,...i};try{let{data:n}=await(0,T.A)(e,{query:r,responseType:"xml",signal:s});return t?.version||function(e){let t=null;t="string"==typeof e?(new DOMParser).parseFromString(e,"text/xml"):e;const n=t.documentElement.getAttribute("version"),i=n?.slice(0,3);return null!=i&&i<"2.1"}(n)||(r[o]="2.0.1",({data:n}=await(0,T.A)(e,{query:r,responseType:"xml",signal:s}))),E(n)}catch(e){if(!(0,l.zf)(e))throw new a.A("wcslayer:open","wcs capabilities is not valid or supported");throw e}}(this.url,{version:t?.version??this.version,customParameters:t,signal:n});if(this.capabilities=i,!this.version){let e=i.version.slice(0,3);"2.0"===e||"1.1"===e||"1.0"===e?this.version=i.version:(e=i.supportedVersions.find((e=>"2.0.1"===e))||i.supportedVersions.find((e=>"2.0"===e.slice(0,3)))||i.supportedVersions.find((e=>"1.1"===e.slice(0,3)))||i.supportedVersions.find((e=>"1.0"===e.slice(0,3)))||"1.0.0",this.version=e)}const{version:s}=this;if(!fe.has(s))throw new a.A("wcsraster-open",`unsupported WCS version ${s}`);const{gridCoverages:o}=i;if(!o.length)throw new a.A("wcsraster-open","cannot find rectified grid coverages");this.coverageId??=o[0].id;const{coverageId:r}=this,c=o.find((e=>e.id===r));if(null==c)throw new a.A("wcsraster-open",`the coverageId ${r} does not exist in capabilities`);const u=await ie(this.url,{coverageIds:[r],version:s,customParameters:t,signal:n});if(this.coverageInfo=u[0],"2.0"===s.slice(0,3)){const{coverageInfo:e}=this;e.lonLatEnvelope=c.lonLatEnvelope,e.supportedInterpolations=G(i.supportedInterpolations),this._patchDimensionValues201(r,n)}this.datasetName=this.coverageInfo.title;const{rasterInfo:p}=this.coverageInfo;if(this.createRemoteDatasetStorageInfo(p,512,512),this._set("rasterInfo",p),null==p.spatialReference)throw new a.A("wcsraster-open",`coverage without spatial reference is not supported: ${r}`);const{pixelType:d,bandCount:m}=await this._getPixelTypeAndBandCount(n);p.pixelType=d,1===p.bandCount&&m>1&&(p.bandCount=m),this.updateTileInfo()}async _patchDimensionValues201(e,t){const{coverageInfo:n}=this,i=n.rasterInfo.multidimensionalInfo?.variables,s=fe.has("1.1.2")?"1.1.2":fe.has("1.1.1")?"1.1.1":fe.has("1.1.0")?"1.1.0":null,{customFetchParameters:o}=this.ioConfig;if(i&&s)try{const n=this.url.includes("/ImageServer/"),a=e.length>8&&e.startsWith("Coverage")&&n?e.slice(8):e,r=await ie(this.url,{coverageIds:[a??e],version:s,customParameters:o,signal:t}).catch((()=>{if(a)return ie(this.url,{coverageIds:[e],version:s,customParameters:o,signal:t})})),l=r?.[0].rasterInfo.multidimensionalInfo?.variables;if(l)for(const e of i){const t=l.find((({name:t})=>t===e.name));if(t?.dimensions?.length)for(let i=e.dimensions.length-1;i>=0;i--){const s=e.dimensions[i],o=t.dimensions.find((({name:e})=>e===s.name));o?o.values&&o.extent?.join(",")===s.extent?.join(",")&&(e.dimensions[i]={...s,values:o.values}):n&&e.dimensions.splice(i,1)}}}catch{}}async _getPixelTypeAndBandCount(e){const{pixelSize:t,extent:n,multidimensionalInfo:i}=this.rasterInfo,s=n.center,o=new D.A({xmin:s.x-t.x,xmax:s.x+t.x,ymin:s.y-t.y,ymax:s.y+t.y,spatialReference:n.spatialReference});let r=[];if(null!=i){const e=i.variables[0];r=[],e.dimensions.forEach((t=>{r.push(new se.A({variableName:e.name,dimensionName:t.name,values:t.hasRegularIntervals?t.extent?.[0]:t.values?.[0],isSlice:!0}))}))}const{coverageDescription:l}=this.coverageInfo,c={interpolation:"nearest",multidimensionalDefinition:r,signal:e},{version:u}=l,{ioConfig:d}=this,m="2.0"===u&&null==d.allowAnyMediaType||"1.1"===u&&null==d.use2GridOffsets;let f;try{f=await this._getCoverage(o,2,2,1,c,!0)}catch(e){if(!m)throw e;if("1.1"===u){if(!e.details?.isResolutionMismatch)throw e;d.use2GridOffsets=!0}}if(!f&&m&&("2.0"===u&&(d.allowAnyMediaType=!0),f=await this._getCoverage(o,2,2,1,c),f&&p.A.getLogger(this).warn("wcsraster:getcoverage",me)),!f)throw new a.A("wcsraster-open","unable to determine pixel type");const g=await this.decodePixelBlock(f,{width:2,height:2,planes:null,pixelType:null});if(null==g)throw new a.A("wcsraster-open","unable to determine pixel type");return{pixelType:g.pixelType,bandCount:g.getPlaneCount()??0}}async _getCoverage(e,t,n,i,s,o=!1){const{coverageDescription:r}=this.coverageInfo,{version:l}=r,c="2.0"===l?this._getCoverage201Parameters(e,t,n,i,s,r):"1.1"===l?this._getCoverage110Parameters(e,t,n,s,r):this._getCoverage100Parameters(e,t,n,s),u="2.0"===l?await this.request(this._constructWCS201Url(c),{signal:s.signal,responseType:"array-buffer"}):await this.request(this.url,{query:c,signal:s.signal,responseType:"array-buffer"});if("1.0"===l)return u.data;if("2.0"===l&&!1!==this.ioConfig.allowAnyMediaType&&"tiff"===(0,ce.g)(u.data))return o&&(this.ioConfig.allowAnyMediaType=!0,p.A.getLogger(this).warn("wcsraster:getcoverage",me)),u.data;const d=ae(u);if(d.isMultipart&&d.data){const e=d.data.find((e=>e.isValidImage));return o&&"base64"===e?.contentTransferEncoding&&p.A.getLogger(this).warn("wcsraster:getcoverage","response is base64 encoded which may impact layer display performance"),e?.contentData}const m=new Uint8Array(u.data,0,Math.min(u.data.byteLength,2e3)),f=String.fromCharCode.apply(null,m).toLowerCase().includes("exception"),g=f&&String.fromCharCode.apply(null,m).includes("A non-zero RESX/RESY or WIDTH/HEIGHT is required but neither was provided");if(f)throw new a.A("wcsraster:getcoverage","server returns an exception",{isResolutionMismatch:g});throw new a.A("wcsraster:getcoverage","response is not a supported multipart mediaType with inline tiff")}_getInterpolationIndex(e){return e&&this.coverageInfo.supportedInterpolations?.includes(e)?"nearest"===e?0:"bilinear"===e?1:"cubic"===e?2:0:0}_getCoverage100Parameters(e,t,n,i){const s=`${e.xmin},${e.ymin},${e.xmax},${e.ymax}`,o=e.spatialReference.wkid,a=(this.coverageInfo.supportedFormats||[]).find((e=>e.toLowerCase().includes("tiff")))||"GEOTIFF",{bandIds:r,interpolation:l}=i,c=this._getInterpolationIndex(l),u=r?r.map((e=>this.coverageInfo.bandNames[e])):null,p=pe[c],{multidimensionalDefinition:d}=i;let m;if(null!=d&&null!=this.rasterInfo.multidimensionalInfo){const e=d.find((e=>"StdTime"===e.dimensionName));let t=e?.values;t&&t.length>0&&(Array.isArray(t[0])&&(t=t[0]),m=t.map((e=>he(e))).join(","))}return{service:"WCS",request:"GetCoverage",version:this.version,coverage:this.coverageId,format:a,crs:`EPSG:${o}`,bbox:s,width:t,height:n,time:m,interpolation:p,band:u?.join(",")}}_getCoverage110Parameters(e,t,n,i,s){const{multidimensionalDefinition:o,bandIds:a,interpolation:r}=i,l=e.spatialReference.wkid,c=`urn:ogc:def:crs:EPSG::${l}`,u=(this.coverageInfo.supportedFormats||[]).find((e=>e.toLowerCase().includes("tiff")))||"image/tiff",p=this._getInterpolationIndex(r),d=de[p],m=null==r||0===this.coverageInfo.supportedInterpolations?.indexOf(r),f=s.domain.spatialDomain,g=f.origin.x<=f.envelope.xmin&&f.origin.y<=f.envelope.ymin,h=e.width/t,v=e.height/n*(g?1:-1),y=g?[e.xmin,e.ymin]:[e.xmin,e.ymax],b=f.useEPSGAxis&&(0,A.m)(l),w=b?`${y[1]},${y[0]}`:`${y[0]},${y[1]}`,x=this.ioConfig.use2GridOffsets,C=b?x?`${v},${h}`:`${v},0,0,${h}`:x?`${h},${v}`:`${h},0,0,${v}`,I=h/2,S=e.xmin+I,D=e.xmax-I,T=Math.abs(v)/2,L=e.ymin+T,V=e.ymax-T,M=b?`${L},${S},${V},${D},${c}`:`${S},${L},${D},${V},${c}`,N=s.range.find((e=>e.axis.some((e=>e.identifier.toLowerCase().includes("band")))));let R,P=N&&d&&a?m?`${N.identifier}[${N.axis[0].identifier}[${a.join(",")}]]`:`${N.identifier}:${d}[${N.axis[0].identifier}[${a.join(",")}]]`:null;if(null!=o&&o.length)for(let e=0;e<o.length;e++){let t=o[e].values;const n=o[e].dimensionName?.toLowerCase(),i=o[e].variableName?.toLowerCase(),a=s.range.find((e=>e.identifier.toLowerCase()===i));if(t.length>0)if(Array.isArray(t[0])&&(t=t[0]),"stdtime"===n)R=t.map((e=>he(e))).join(",");else if(a){const e=a.axis.find((e=>e.identifier.toLowerCase()===n));e&&(P=m?a.identifier+"["+e.identifier+"["+t.join(",")+"]]":a.identifier+":"+d+"["+e.identifier+"["+t.join(",")+"]]")}e===o.length-1&&a&&!P&&(P=m?a.identifier:a.identifier+":"+d)}return{service:"WCS",request:"GetCoverage",version:this.version,identifier:this.coverageId,format:u,crs:`EPSG:${l}`,boundingbox:M,gridCS:"urn:ogc:def:cs:OGC:0.0:Grid2dSquareCS",gridType:"urn:ogc:def:method:WCS:1.1:2dGridIn2dCrs",gridOrigin:w,gridOffsets:C,gridBaseCRS:c,timeSequence:R,rangeSubset:P}}_getCoverage201Parameters(e,t,n,i,s,o){const{multidimensionalDefinition:a,interpolation:r}=s,l=this._getInterpolationIndex(r);let c=null;const{supportedInterpolations:u}=this.capabilities;if(u?.length)switch(l){case 0:c=u.find((e=>e.toLowerCase().includes("nearest")));break;case 1:c=u.find((e=>e.toLowerCase().includes("linear")));break;case 2:c=u.find((e=>e.toLowerCase().includes("cubic")||e.toLowerCase().includes("quadratic")))}const p=(this.coverageInfo.supportedFormats||[]).find((e=>e.toLowerCase().includes("tiff")))||"image/tiff",{bandNames:d}=this.coverageInfo,{boundedBy:m,domainSet:f,rangeType:g}=o,h=m.isEastFirst?0:1,v=1-h,{axisLabels:y}=m,b=y[h],w=y[v],x=`http://www.opengis.net/def/crs/EPSG/0/${e.spatialReference.wkid}`,C=x,I=[];I.push(`${b}(${e.xmin},${e.xmax})`),I.push(`${w}(${e.ymin},${e.ymax})`);const S=[];if(y.length>2)for(let e=2;e<y.length;e++){const t=f.origin[e];if(y[e].toLowerCase().includes("time")){let n=t.toString();m.uomLabels?.[e].toLowerCase().includes("ole")&&(S.push(y[e]),n=he(t,!0)),I.push(y[e]+",http://www.opengis.net("+n+")")}else I.push(y[e]+",http://www.opengis.net("+t+")")}let D=null;if(null!=a&&a.length){const e=[];g.forEach((t=>t.forEach((t=>e.push(t.name)))));const t=[];for(let n=0;n<a.length;n++){const i=y.find((e=>e===a[n].dimensionName)),s=e.find((e=>e===a[n].variableName));if(t.includes(s)||t.push(s),i){let e=a[n].values;if(e.length>0){Array.isArray(e[0])&&(e=e[0]);let t="";t=i.toLowerCase().includes("time")?e.map((e=>he(e))).join(","):e.join(",");const n=I.findIndex((e=>0===e.indexOf(i+",http://www.opengis.net")));-1===n&&I.push(i+",http://www.opengis.net("+t+")"),-1===n||I[n].includes("("+t+")")||I.splice(n,1,i+",http://www.opengis.net("+t+")")}}}t.length&&(D=t.join(","))}else d?.length>=2&&(D=(s.bandIds?s.bandIds.map((e=>d[e])):d).join(","));const A=I.join("&subset="),T=!o.domainSet.hasSameAxisLabelsAsBoundedBy&&!1!==this.ioConfig.allowScaleFactor,L=T?null:`${b}(${t}),${w}(${n})`,V=T?1/i:null;return{service:"WCS",request:"GetCoverage",version:this.version,coverageId:this.coverageId,rangesubset:D,interpolation:c,scaleSize:L,scaleFactor:V,subset:A,format:p,mediaType:this.ioConfig.allowAnyMediaType?null:"multipart/related",outputcrs:x,subsettingcrs:C}}_constructWCS201Url(e){const t={...this.ioConfig.customFetchParameters,...e},n=[];return Object.keys(t).forEach((e=>{const i=t[e];null!=i&&("subset"===e?"string"==typeof i&&i.split("&subset=").forEach((e=>{e&&n.push(`subset=${encodeURIComponent(e)}`)})):n.push(`${e}=${encodeURIComponent(i)}`))})),`${encodeURI(this.url)}?${n.join("&")}`}};function he(e,t=!1){return(t?new Date((0,X.$E)(e)):new Date(e)).toISOString()}(0,i._)([(0,u.MZ)({type:String,json:{write:!0}})],ge.prototype,"datasetFormat",void 0),(0,i._)([(0,u.MZ)({readOnly:!0})],ge.prototype,"tileType",void 0),(0,i._)([(0,u.MZ)({type:String,json:{write:!0}})],ge.prototype,"version",void 0),(0,i._)([(0,u.MZ)({type:String,json:{write:!0}})],ge.prototype,"coverageId",void 0),(0,i._)([(0,u.MZ)({readOnly:!0})],ge.prototype,"rasterId",null),ge=(0,i._)([(0,d.$)("esri.layers.support.rasterDatasets.WCSRaster")],ge);const ve=ge;var ye=n(30291),be=n(92935);const we=new Set(["milliseconds","seconds","minutes","hours","days","weeks","months","years","decades","centuries"]);let xe=class extends((0,f.dM)((0,w.j)((0,v.q)((0,y.A)((0,g.d)((0,h.o)((0,x.e)((0,b.J)((0,r.P)(o.A.ClonableMixin(m.A))))))))))){constructor(...e){super(...e),this.coverageId=null,this.version=null,this.isReference=null,this.legendEnabled=!0,this.noData=0,this.operationalLayerType="WCS",this.type="wcs",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null,this._debouncedSaveOperations=(0,l.sg)((async(e,t,i)=>{const{save:s,saveAs:o}=await n.e(9838).then(n.bind(n,59838));switch(e){case be.X.SAVE:return s(this,t);case be.X.SAVE_AS:return o(this,i,t)}}))}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WCS"]},e).catch(l.QP).then((()=>this._openRaster(t)))),Promise.resolve(this)}get coverageInfo(){return this.raster.coverageInfo}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){return[(0,S.rZ)("Pixel Value")]}createPopupTemplate(e){return(0,ye.tn)({fields:this.rasterFields,title:this.title},e)}async save(e){return this._debouncedSaveOperations(be.X.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(be.X.SAVE_AS,t,e)}async _openRaster(e){const t=new ve({url:this.url,version:this.version,coverageId:this.coverageId,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters}});if(await t.open({signal:e}),!t.rasterInfo)throw t.destroy(),new a.A("wcs-layer:load","cannot load resources on "+this.url);const{rasterInfo:n}=t;null==n.noDataValue&&(n.noDataValue=this.noData),this._set("serviceRasterInfo",n),this._set("spatialReference",n.spatialReference),null==this.title&&this.setAtOrigin("title",t.datasetName,"service"),null==this.coverageId&&this.setAtOrigin("coverageId",t.coverageInfo.id,"service"),null==this.version&&t.version&&this.setAtOrigin("version",t.version,"service"),this.setAtOrigin("tileInfo",t.rasterInfo.storageInfo.tileInfo,"service");const{multidimensionalInfo:i}=n;if(null!=i){const e=i.variables[0].dimensions.find((({name:e})=>"StdTime"===e));if(e){let t=e.extent?.[0]??e.values[0];Array.isArray(t)&&(t=t[0]);let n=e.extent?.[1]??e.values[e.values.length-1];Array.isArray(n)&&(n=n[1]);const i=we.has(e.intervalUnit?.toLowerCase())?e.intervalUnit?.toLowerCase():null;this.set("timeInfo",{startField:"StdTime",fullTimeExtent:{start:t,end:n},timeZone:null,interval:i?{value:e.interval,unit:i}:null})}}this.raster=t,this._configDefaultSettings(),this.addHandles((0,c.wB)((()=>this.customParameters),(e=>this.raster.ioConfig.customFetchParameters=e)))}};(0,i._)([(0,u.MZ)({type:String,nonNullable:!0,json:{name:"wcsInfo.coverageId",write:{isRequired:!0,ignoreOrigin:!0}}})],xe.prototype,"coverageId",void 0),(0,i._)([(0,u.MZ)()],xe.prototype,"coverageInfo",null),(0,i._)([(0,u.MZ)({type:["1.0.0","1.1.0","1.1.1","1.1.2","2.0.1"],nonNullable:!0,json:{name:"wcsInfo.version",write:{isRequired:!0,ignoreOrigin:!0}}})],xe.prototype,"version",void 0),(0,i._)([(0,u.MZ)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],xe.prototype,"isReference",void 0),(0,i._)([(0,u.MZ)({json:{read:!0,write:!0}})],xe.prototype,"blendMode",void 0),(0,i._)([(0,u.MZ)(C.fV)],xe.prototype,"legendEnabled",void 0),(0,i._)([(0,u.MZ)({type:["show","hide"]})],xe.prototype,"listMode",void 0),(0,i._)([(0,u.MZ)()],xe.prototype,"noData",void 0),(0,i._)([(0,u.MZ)({type:["WCS"]})],xe.prototype,"operationalLayerType",void 0),(0,i._)([(0,u.MZ)()],xe.prototype,"raster",void 0),(0,i._)([(0,u.MZ)({readOnly:!0})],xe.prototype,"type",void 0),(0,i._)([(0,u.MZ)(C.M6)],xe.prototype,"popupEnabled",void 0),(0,i._)([(0,u.MZ)({type:s.A,json:{name:"popupInfo",write:!0}})],xe.prototype,"popupTemplate",void 0),(0,i._)([(0,u.MZ)({readOnly:!0})],xe.prototype,"defaultPopupTemplate",null),(0,i._)([(0,u.MZ)({readOnly:!0,type:[I.A]})],xe.prototype,"fields",void 0),(0,i._)([(0,u.MZ)({readOnly:!0,type:[I.A]})],xe.prototype,"rasterFields",null),xe=(0,i._)([(0,d.$)("esri.layers.WCSLayer")],xe);const Ce=xe},38458:(e,t,n)=>{n.d(t,{m:()=>s});const i=[[3819,3819],[3821,3824],[3889,3889],[3906,3906],[4001,4025],[4027,4036],[4039,4047],[4052,4055],[4074,4075],[4080,4081],[4120,4176],[4178,4185],[4188,4216],[4218,4289],[4291,4304],[4306,4319],[4322,4326],[4463,4463],[4470,4470],[4475,4475],[4483,4483],[4490,4490],[4555,4558],[4600,4646],[4657,4765],[4801,4811],[4813,4821],[4823,4824],[4901,4904],[5013,5013],[5132,5132],[5228,5229],[5233,5233],[5246,5246],[5252,5252],[5264,5264],[5324,5340],[5354,5354],[5360,5360],[5365,5365],[5370,5373],[5381,5381],[5393,5393],[5451,5451],[5464,5464],[5467,5467],[5489,5489],[5524,5524],[5527,5527],[5546,5546],[2044,2045],[2081,2083],[2085,2086],[2093,2093],[2096,2098],[2105,2132],[2169,2170],[2176,2180],[2193,2193],[2200,2200],[2206,2212],[2319,2319],[2320,2462],[2523,2549],[2551,2735],[2738,2758],[2935,2941],[2953,2953],[3006,3030],[3034,3035],[3038,3051],[3058,3059],[3068,3068],[3114,3118],[3126,3138],[3150,3151],[3300,3301],[3328,3335],[3346,3346],[3350,3352],[3366,3366],[3389,3390],[3416,3417],[3833,3841],[3844,3850],[3854,3854],[3873,3885],[3907,3910],[4026,4026],[4037,4038],[4417,4417],[4434,4434],[4491,4554],[4839,4839],[5048,5048],[5105,5130],[5253,5259],[5269,5275],[5343,5349],[5479,5482],[5518,5519],[5520,5520],[20004,20032],[20064,20092],[21413,21423],[21473,21483],[21896,21899],[22171,22177],[22181,22187],[22191,22197],[25884,25884],[27205,27232],[27391,27398],[27492,27492],[28402,28432],[28462,28492],[30161,30179],[30800,30800],[31251,31259],[31275,31279],[31281,31290],[31466,31700]];function s(e){return null!=e&&i.some((([t,n])=>e>=t&&e<=n))}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1346],{61346:(e,t,n)=>{n.r(t),n.d(t,{registerFunctions:()=>P});var i=n(66131),a=n(47609),r=n(66395),s=n(85935),o=n(93833),l=n(40334),f=n(93818),d=n(78878),u=n(80672),c=n(68423),m=n(35704),y=n(86691),p=n(54461),w=n(85978),h=n(30235),D=n(87594),I=n(33325),g=n(80609),F=n(334),T=n(74887),A=n(88368),$=n(13600),x=n(20437),b=n(20655),E=n(54218);function N(e,t,n){const i=e.getVariables();if(i.length>0){const a={};for(const e of i)a[e]=t.evaluateIdentifier(n,{name:e});e.parameters=a}return e}function S(e,t,n=null){for(const n in e)if(n.toLowerCase()===t.toLowerCase())return e[n];return n}function L(e){if(null===e)return null;const t={type:S(e,"type",""),name:S(e,"name","")};if("range"===t.type)t.range=S(e,"range",[]);else{t.codedValues=[];for(const n of S(e,"codedValues",[]))t.codedValues.push({name:S(n,"name",""),code:S(n,"code",null)})}return t}function C(e){if(null===e)return null;const t={},n=S(e,"wkt");null!==n&&(t.wkt=n);const i=S(e,"wkid");return null!==i&&(t.wkid=i),t}function Z(e){if(null===e)return null;const t={hasZ:S(e,"hasz",!1),hasM:S(e,"hasm",!1)},n=S(e,"spatialreference");null!=n&&(t.spatialReference=C(n));const i=S(e,"x",null);if(null!==i)return t.x=i,t.y=S(e,"y",null),t.hasZ&&(t.z=S(e,"z",null)),t.hasM&&(t.m=S(e,"m",null)),t;const a=S(e,"rings",null);if(null!==a)return t.rings=a,t;const r=S(e,"paths",null);if(null!==r)return t.paths=r,t;const s=S(e,"points",null);if(null!==s)return t.points=s,t;for(const n of["xmin","xmax","ymin","ymax","zmin","zmax","mmin","mmax"]){const i=S(e,n,null);null!==i&&(t[n]=i)}return t}function v(e){return"utc"===e?.toLowerCase()?"UTC":"unknown"===e?.toLowerCase()?"Unknown":e}function P(e){"async"===e.mode&&(e.functions.timezone=function(t,n){return e.standardFunctionAsync(t,n,(async(e,a,o)=>{if((0,d.D)(o,1,2,t,n),(0,d.k)(o[0]))return"Unknown";if((0,d.j)(o[0]))return"Unknown";if((0,d.p)(o[0])){if(await o[0].load(),1===o.length||null===o[1])return o[0].datesInUnknownTimezone?v("unknown"):v(o[0].dateFieldsTimeZone);if(!(o[1]instanceof r.A)||!1===o[1].hasField("type"))throw new s.D$(t,s.TX.InvalidParameter,n);const e=o[1].field("type");if(!1===(0,E.Kg)(e))throw new s.D$(t,s.TX.InvalidParameter,n);switch((0,d.f)(e).toLowerCase()){case"preferredtimezone":return v(o[0].preferredTimeZone);case"editfieldsinfo":return v(o[0].editFieldsInfo?.timeZone??null);case"timeinfo":return v(o[0].timeInfo?.timeZone??null);case"field":if(o[1].hasField("fieldname")&&(0,E.Kg)(o[1].field("fieldname")))return v(o[0].fieldTimeZone((0,d.f)(o[1].field("fieldname"))))}throw new s.D$(t,s.TX.InvalidParameter,n)}const l=(0,d.h)(o[0],(0,d.L)(t));if(null===l)return null;const f=l.timeZone;return"system"===f?i.lY.systemTimeZoneCanonicalName:"utc"===f.toLowerCase()?"UTC":"unknown"===f.toLowerCase()?"Unknown":f}))},e.functions.sqltimestamp=function(t,n){return e.standardFunctionAsync(t,n,(async(e,i,a)=>{(0,d.D)(a,1,3,t,n);const r=a[0];if((0,d.g)(r)){if(1===a.length)return r.toSQLWithKeyword();if(2===a.length)return r.changeTimeZone((0,d.f)(a[1])).toSQLWithKeyword();throw new s.D$(t,s.TX.InvalidParameter,n)}if((0,d.j)(r))return r.toSQLWithKeyword();if((0,d.p)(r)){if(3!==a.length)throw new s.D$(t,s.TX.InvalidParameter,n);await r.load();const e=(0,d.f)(a[1]);if((0,d.j)(a[2]))return a[2].toSQLWithKeyword();if(!1===(0,d.g)(a[2]))throw new s.D$(t,s.TX.InvalidParameter,n);const i=r.fieldTimeZone(e);return null==i?a[2].toSQLWithKeyword():a[2].changeTimeZone(i).toSQLWithKeyword()}throw new s.D$(t,s.TX.InvalidParameter,n)}))},e.signatures.push({name:"sqltimestamp",min:2,max:4}),e.functions.featuresetbyid=function(t,n){return e.standardFunctionAsync(t,n,((e,i,a)=>{if((0,d.D)(a,2,4,t,n),(0,d.o)(a[0])){const e=(0,d.f)(a[1]);let i=(0,d.K)(a[2],null);const r=(0,d.e)((0,d.K)(a[3],!0));if(null===i&&(i=["*"]),!1===(0,E.cy)(i))throw new s.D$(t,s.TX.InvalidParameter,n);return a[0].featureSetById(e,r,i)}throw new s.D$(t,s.TX.InvalidParameter,n)}))},e.signatures.push({name:"featuresetbyid",min:2,max:4}),e.functions.getfeatureset=function(t,n){return e.standardFunctionAsync(t,n,(async(e,i,a)=>{if((0,d.D)(a,1,2,t,n),(0,d.n)(a[0])){let e=(0,d.K)(a[1],"datasource");return null===e&&(e="datasource"),e=(0,d.f)(e).toLowerCase(),(0,l.convertToFeatureSet)(a[0].fullSchema(),e,t.lrucache,t.interceptor,t.spatialReference)}throw new s.D$(t,s.TX.InvalidParameter,n)}))},e.signatures.push({name:"getfeatureset",min:1,max:2}),e.functions.featuresetbyportalitem=function(t,n){return e.standardFunctionAsync(t,n,((e,i,r)=>{if((0,d.D)(r,2,5,t,n),null===r[0])throw new s.D$(t,s.TX.PortalRequired,n);if(r[0]instanceof a.A){const e=(0,d.f)(r[1]),i=(0,d.f)(r[2]);let a=(0,d.K)(r[3],null);const o=(0,d.e)((0,d.K)(r[4],!0));if(null===a&&(a=["*"]),!1===(0,E.cy)(a))throw new s.D$(t,s.TX.InvalidParameter,n);let f;return f=t.services?.portal?t.services.portal:b.A.getDefault(),f=(0,u.R)(r[0],f),(0,l.constructFeatureSetFromPortalItem)(e,i,t.spatialReference,a,o,f,t.lrucache,t.interceptor)}if(!1===(0,E.Kg)(r[0]))throw new s.D$(t,s.TX.PortalRequired,n);const o=(0,d.f)(r[0]),f=(0,d.f)(r[1]);let c=(0,d.K)(r[2],null);const m=(0,d.e)((0,d.K)(r[3],!0));if(null===c&&(c=["*"]),!1===(0,E.cy)(c))throw new s.D$(t,s.TX.InvalidParameter,n);return(0,l.constructFeatureSetFromPortalItem)(o,f,t.spatialReference,c,m,t.services?.portal??b.A.getDefault(),t.lrucache,t.interceptor)}))},e.signatures.push({name:"featuresetbyportalitem",min:2,max:5}),e.functions.featuresetbyname=function(t,n){return e.standardFunctionAsync(t,n,((e,i,a)=>{if((0,d.D)(a,2,4,t,n),(0,d.o)(a[0])){const e=(0,d.f)(a[1]);let i=(0,d.K)(a[2],null);const r=(0,d.e)((0,d.K)(a[3],!0));if(null===i&&(i=["*"]),!1===(0,E.cy)(i))throw new s.D$(t,s.TX.InvalidParameter,n);return a[0].featureSetByName(e,r,i)}throw new s.D$(t,s.TX.InvalidParameter,n)}))},e.signatures.push({name:"featuresetbyname",min:2,max:4}),e.functions.featureset=function(t,n){return e.standardFunction(t,n,((e,i,a)=>{(0,d.D)(a,1,1,t,n);const o={layerDefinition:{geometryType:"",objectIdField:"",globalIdField:"",typeIdField:"",hasM:!1,hasZ:!1,fields:[]},featureSet:{geometryType:"",features:[]}};if((0,E.Kg)(a[0])){const e=JSON.parse(a[0]);void 0!==e.layerDefinition?(o.layerDefinition=e.layerDefinition,o.featureSet=e.featureSet,e.layerDefinition.spatialReference&&(o.layerDefinition.spatialReference=e.layerDefinition.spatialReference)):(o.featureSet.features=e.features,o.featureSet.geometryType=e.geometryType,o.layerDefinition.geometryType=o.featureSet.geometryType,o.layerDefinition.objectIdField=e.objectIdFieldName??"",o.layerDefinition.typeIdField=e.typeIdFieldName,o.layerDefinition.globalIdField=e.globalIdFieldName,o.layerDefinition.fields=e.fields,e.spatialReference&&(o.layerDefinition.spatialReference=e.spatialReference))}else{if(!(a[0]instanceof r.A))throw new s.D$(t,s.TX.InvalidParameter,n);{const e=JSON.parse(a[0].castToText(!0)),i=S(e,"layerdefinition");if(null!==i){o.layerDefinition.geometryType=S(i,"geometrytype",""),o.featureSet.geometryType=o.layerDefinition.geometryType,o.layerDefinition.globalIdField=S(i,"globalidfield",""),o.layerDefinition.objectIdField=S(i,"objectidfield",""),o.layerDefinition.typeIdField=S(i,"typeidfield",""),o.layerDefinition.hasZ=!0===S(i,"hasz",!1),o.layerDefinition.hasM=!0===S(i,"hasm",!1);const t=S(i,"spatialreference");t&&(o.layerDefinition.spatialReference=C(t));const n=[];for(const e of S(i,"fields",[])){const t={name:S(e,"name",""),alias:S(e,"alias",""),type:S(e,"type",""),nullable:S(e,"nullable",!0),editable:S(e,"editable",!0),length:S(e,"length",null),domain:L(S(e,"domain"))};n.push(t)}o.layerDefinition.fields=n;const a=S(e,"featureset");if(a){const e={};for(const t of n)e[t.name.toLowerCase()]=t.name;for(const t of S(a,"features",[])){const n={},i=S(t,"attributes",{});for(const t in i)n[e[t.toLowerCase()]]=i[t];o.featureSet.features.push({attributes:n,geometry:Z(S(t,"geometry"))})}}}else{o.layerDefinition.hasZ=!0===S(e,"hasz",!1),o.layerDefinition.hasM=!0===S(e,"hasm",!1),o.layerDefinition.geometryType=S(e,"geometrytype",""),o.featureSet.geometryType=o.layerDefinition.geometryType,o.layerDefinition.objectIdField=S(e,"objectidfieldname",""),o.layerDefinition.typeIdField=S(e,"typeidfieldname","");const i=S(e,"spatialreference");i&&(o.layerDefinition.spatialReference=C(i));const a=[],r=S(e,"fields",null);if(!(0,E.cy)(r))throw new s.D$(t,s.TX.InvalidParameter,n);for(const e of r){const t={name:S(e,"name",""),alias:S(e,"alias",""),type:S(e,"type",""),nullable:S(e,"nullable",!0),editable:S(e,"editable",!0),length:S(e,"length",null),domain:L(S(e,"domain"))};a.push(t)}o.layerDefinition.fields=a;const l={};for(const e of a)l[e.name.toLowerCase()]=e.name;let f=S(e,"features",null);if((0,E.cy)(f))for(const e of f){const t={},n=S(e,"attributes",{});for(const e in n)t[l[e.toLowerCase()]]=n[e];o.featureSet.features.push({attributes:t,geometry:Z(S(e,"geometry",null))})}else f=null,o.featureSet.features=f}}}if(!1===function(e){return!!e.layerDefinition&&!!e.featureSet&&!1!==function(e){for(const t of["",null,"esriGeometryNull","esriGeometryPoint","esriGeometryPolyline","esriGeometryPolygon","esriGeometryMultipoint","esriGeometryEnvelope"])if(t===e)return!0;return!1}(e.layerDefinition.geometryType)&&!1!==(0,E.cy)(e.layerDefinition.fields)&&!1!==(0,E.cy)(e.featureSet.features)}(o))throw new s.D$(t,s.TX.InvalidParameter,n);return o.layerDefinition.geometryType||(o.layerDefinition.geometryType="esriGeometryNull"),h.A.create(o,t.spatialReference)}))},e.signatures.push({name:"featureset",min:1,max:1}),e.functions.filter=function(t,n){return e.standardFunctionAsync(t,n,(async(i,a,r)=>{if((0,d.D)(r,2,2,t,n),(0,E.cy)(r[0])||(0,d.m)(r[0])){const e=[];let i,a=r[0];if(a instanceof f.A&&(a=a.toArray()),!(0,d.i)(r[1]))throw new s.D$(t,s.TX.InvalidParameter,n);i=r[1].createFunction(t);for(const t of a){const n=i(t);(0,T.$X)(n)?!0===await n&&e.push(t):!0===n&&e.push(t)}return e}if((0,d.p)(r[0])){const n=await r[0].load(),i=A.A.create(r[1],{fieldsIndex:n.getFieldsIndex(),timeZone:n.dateFieldsTimeZoneDefaultUTC}),a=i.getVariables();if(a.length>0){const n={};for(const i of a)n[i]=e.evaluateIdentifier(t,{name:i});i.parameters=n}return new m.A({parentfeatureset:r[0],whereclause:i})}throw new s.D$(t,s.TX.InvalidParameter,n)}))},e.signatures.push({name:"filter",min:2,max:2}),e.functions.orderby=function(t,n){return e.standardFunctionAsync(t,n,(async(e,i,a)=>{if((0,d.D)(a,2,2,t,n),(0,d.p)(a[0])){const e=new D.A(a[1]);return new y.A({parentfeatureset:a[0],orderbyclause:e})}throw new s.D$(t,s.TX.InvalidParameter,n)}))},e.signatures.push({name:"orderby",min:2,max:2}),e.functions.top=function(t,n){return e.standardFunctionAsync(t,n,(async(e,i,a)=>{if((0,d.D)(a,2,2,t,n),(0,d.p)(a[0]))return new p.A({parentfeatureset:a[0],topnum:a[1]});if((0,E.cy)(a[0]))return(0,d.t)(a[1])>=a[0].length?a[0].slice():a[0].slice(0,(0,d.t)(a[1]));if((0,d.m)(a[0]))return(0,d.t)(a[1])>=a[0].length()?a[0].slice():a[0].slice(0,(0,d.t)(a[1]));throw new s.D$(t,s.TX.InvalidParameter,n)}))},e.signatures.push({name:"top",min:2,max:2}),e.functions.first=function(t,n){return e.standardFunctionAsync(t,n,(async(e,i,a)=>{if((0,d.D)(a,1,1,t,n),(0,d.p)(a[0])){const n=await a[0].first(e.abortSignal);if(null!==n){const e=o.A.createFromGraphicLikeObject(n.geometry,n.attributes,a[0],t.timeZone);return e._underlyingGraphic=n,e}return n}return(0,E.cy)(a[0])?0===a[0].length?null:a[0][0]:(0,d.m)(a[0])?0===a[0].length()?null:a[0].get(0):null}))},e.signatures.push({name:"first",min:1,max:1}),e.functions.attachments=function(t,n){return e.standardFunctionAsync(t,n,(async(e,i,a)=>{(0,d.D)(a,1,2,t,n);const o={minsize:-1,maxsize:-1,types:null,returnMetadata:!1};if(a.length>1)if(a[1]instanceof r.A){if(a[1].hasField("minsize")&&(o.minsize=(0,d.t)(a[1].field("minsize"))),a[1].hasField("metadata")&&(o.returnMetadata=(0,d.e)(a[1].field("metadata"))),a[1].hasField("maxsize")&&(o.maxsize=(0,d.t)(a[1].field("maxsize"))),a[1].hasField("types")){const e=(0,d.a0)(a[1].field("types"),!1);e.length>0&&(o.types=e)}}else if(null!==a[1])throw new s.D$(t,s.TX.InvalidParameter,n);if((0,d.n)(a[0])){let e=a[0]._layer;return e instanceof $.default&&(e=(0,l.constructFeatureSet)(e,t.spatialReference,["*"],!0,t.lrucache,t.interceptor)),null===e||!1===(0,d.p)(e)?[]:(await e.load(),e.queryAttachments(a[0].field(e.objectIdField),o.minsize,o.maxsize,o.types,o.returnMetadata))}if(null===a[0])return[];throw new s.D$(t,s.TX.InvalidParameter,n)}))},e.signatures.push({name:"attachments",min:1,max:2}),e.functions.featuresetbyrelationshipname=function(t,n){return e.standardFunctionAsync(t,n,(async(e,i,a)=>{(0,d.D)(a,2,4,t,n);const r=a[0],o=(0,d.f)(a[1]);let f=(0,d.K)(a[2],null);const u=(0,d.e)((0,d.K)(a[3],!0));if(null===f&&(f=["*"]),!1===(0,E.cy)(f))throw new s.D$(t,s.TX.InvalidParameter,n);if(null===a[0])return null;if(!(0,d.n)(a[0]))throw new s.D$(t,s.TX.InvalidParameter,n);let c=r._layer;if(c instanceof $.default&&(c=(0,l.constructFeatureSet)(c,t.spatialReference,["*"],!0,t.lrucache,t.interceptor)),null===c)return null;if(!1===(0,d.p)(c))return null;c=await c.load();const m=c.relationshipMetaData().filter((e=>e.name===o));if(0===m.length)return null;if(void 0!==m[0].relationshipTableId&&null!==m[0].relationshipTableId&&m[0].relationshipTableId>-1)return(0,l.constructFeatureSetFromRelationship)(c,m[0],r.field(c.objectIdField),c.spatialReference,f,u,t.lrucache,t.interceptor);let y=c.serviceUrl();if(!y)return null;y="/"===y.charAt(y.length-1)?y+m[0].relatedTableId.toString():y+"/"+m[0].relatedTableId.toString();const p=await(0,l.constructFeatureSetFromUrl)(y,c.spatialReference,f,u,t.lrucache,t.interceptor);await p.load();let h=p.relationshipMetaData();if(h=h.filter((e=>e.id===m[0].id)),!1===r.hasField(m[0].keyField)||null===r.field(m[0].keyField)){const e=await c.getFeatureByObjectId(r.field(c.objectIdField),[m[0].keyField]);if(e){const t=A.A.create(h[0].keyField+"= @id",{fieldsIndex:p.getFieldsIndex(),timeZone:p.dateFieldsTimeZoneDefaultUTC});return t.parameters={id:e.attributes[m[0].keyField]},p.filter(t)}return new w.A({parentfeatureset:p})}const D=A.A.create(h[0].keyField+"= @id",{fieldsIndex:p.getFieldsIndex(),timeZone:p.dateFieldsTimeZoneDefaultUTC});return D.parameters={id:r.field(m[0].keyField)},p.filter(D)}))},e.signatures.push({name:"featuresetbyrelationshipname",min:2,max:4}),e.functions.featuresetbyassociation=function(t,n){return e.standardFunctionAsync(t,n,(async(e,i,a)=>{(0,d.D)(a,2,3,t,n);const r=a[0],o=(0,d.f)((0,d.K)(a[1],"")).toLowerCase(),f=(0,E.Kg)(a[2])?(0,d.f)(a[2]):null;if(null===a[0])return null;if(!(0,d.n)(a[0]))throw new s.D$(t,s.TX.InvalidParameter,n);let u=r._layer;if(u instanceof $.default&&(u=(0,l.constructFeatureSet)(u,t.spatialReference,["*"],!0,t.lrucache,t.interceptor)),null===u)return null;if(!1===(0,d.p)(u))return null;await u.load();const m=u.serviceUrl(),y=await(0,l.constructAssociationMetaDataFeatureSetFromUrl)(m,t.spatialReference);let p=null,w=null,h=!1;if(null!==f&&""!==f&&void 0!==f){for(const e of y.terminals)e.terminalName===f&&(w=e.terminalId);null===w&&(h=!0)}const D=y.associations.getFieldsIndex(),g=D.get("TOGLOBALID").name,F=D.get("FROMGLOBALID").name,T=D.get("TOTERMINALID").name,b=D.get("FROMTERMINALID").name,N=D.get("FROMNETWORKSOURCEID").name,S=D.get("TONETWORKSOURCEID").name,L=D.get("ASSOCIATIONTYPE").name,C=D.get("ISCONTENTVISIBLE").name,Z=D.get("OBJECTID").name;for(const e of u.fields)if("global-id"===e.type){p=r.field(e.name);break}let v=null,P=new c.Gr(new x.A({name:"percentalong",alias:"percentalong",type:"double"}),A.A.create("0",{fieldsIndex:y.associations.getFieldsIndex(),timeZone:y.associations.dateFieldsTimeZoneDefaultUTC})),X=new c.Gr(new x.A({name:"side",alias:"side",type:"string"}),A.A.create("''",{fieldsIndex:y.associations.getFieldsIndex(),timeZone:y.associations.dateFieldsTimeZoneDefaultUTC}));const R="globalid",k="globalId",U={};for(const e in y.lkp)U[e]=y.lkp[e].sourceId;const M=new c.bV(new x.A({name:"classname",alias:"classname",type:"string"}),null,U);let K="";switch(o){case"midspan":{K=`((${g}='${p}') OR ( ${F}='${p}')) AND (${L} IN (5))`,M.codefield=A.A.create(`CASE WHEN (${g}='${p}') THEN ${N} ELSE ${S} END`,{fieldsIndex:y.associations.getFieldsIndex(),timeZone:y.associations.dateFieldsTimeZoneDefaultUTC});const e=(0,I.ke)(c.a.findField(y.associations.fields,F));e.name=R,e.alias=R,v=new c.Gr(e,A.A.create(`CASE WHEN (${F}='${p}') THEN ${g} ELSE ${F} END`,{fieldsIndex:y.associations.getFieldsIndex(),timeZone:y.associations.dateFieldsTimeZoneDefaultUTC})),P=y.unVersion>=4?new c.IO(c.a.findField(y.associations.fields,D.get("PERCENTALONG").name)):new c.Gr(new x.A({name:"percentalong",alias:"percentalong",type:"double"}),A.A.create("0",{fieldsIndex:y.associations.getFieldsIndex(),timeZone:y.associations.dateFieldsTimeZoneDefaultUTC}));break}case"junctionedge":{K=`((${g}='${p}') OR ( ${F}='${p}')) AND (${L} IN (4,6))`,M.codefield=A.A.create(`CASE WHEN (${g}='${p}') THEN ${N} ELSE ${S} END`,{fieldsIndex:y.associations.getFieldsIndex(),timeZone:y.associations.dateFieldsTimeZoneDefaultUTC});const e=(0,I.ke)(c.a.findField(y.associations.fields,F));e.name=R,e.alias=R,v=new c.Gr(e,A.A.create(`CASE WHEN (${F}='${p}') THEN ${g} ELSE ${F} END`,{fieldsIndex:y.associations.getFieldsIndex(),timeZone:y.associations.dateFieldsTimeZoneDefaultUTC})),X=new c.Gr(new x.A({name:"side",alias:"side",type:"string"}),A.A.create(`CASE WHEN (${L}=4) THEN 'from' ELSE 'to' END`,{fieldsIndex:y.associations.getFieldsIndex(),timeZone:y.associations.dateFieldsTimeZoneDefaultUTC}));break}case"connected":{let e=`${g}='@T'`,t=`${F}='@T'`;null!==w&&(e+=` AND ${T}=@A`,t+=` AND ${b}=@A`),K="(("+e+") OR ("+t+"))",K=(0,d.X)(K,"@T",p??""),e=(0,d.X)(e,"@T",p??""),null!==w&&(e=(0,d.X)(e,"@A",w.toString()),K=(0,d.X)(K,"@A",w.toString())),M.codefield=A.A.create("CASE WHEN "+e+` THEN ${N} ELSE ${S} END`,{fieldsIndex:y.associations.getFieldsIndex(),timeZone:y.associations.dateFieldsTimeZoneDefaultUTC});const n=(0,I.ke)(c.a.findField(y.associations.fields,F));n.name=R,n.alias=R,v=new c.Gr(n,A.A.create("CASE WHEN "+e+` THEN ${F} ELSE ${g} END`,{fieldsIndex:y.associations.getFieldsIndex(),timeZone:y.associations.dateFieldsTimeZoneDefaultUTC}));break}case"container":K=`${g}='${p}' AND ${L} = 2`,null!==w&&(K+=` AND ${T} = `+w.toString()),M.codefield=N,K="( "+K+" )",v=new c.p8(c.a.findField(y.associations.fields,F),R,R);break;case"content":K=`(${F}='${p}' AND ${L} = 2)`,null!==w&&(K+=` AND ${b} = `+w.toString()),M.codefield=S,K="( "+K+" )",v=new c.p8(c.a.findField(y.associations.fields,g),R,R);break;case"structure":K=`(${g}='${p}' AND ${L} = 3)`,null!==w&&(K+=` AND ${T} = `+w.toString()),M.codefield=N,K="( "+K+" )",v=new c.p8(c.a.findField(y.associations.fields,F),R,k);break;case"attached":K=`(${F}='${p}' AND ${L} = 3)`,null!==w&&(K+=` AND ${b} = `+w.toString()),M.codefield=S,K="( "+K+" )",v=new c.p8(c.a.findField(y.associations.fields,g),R,k);break;default:throw new s.D$(t,s.TX.InvalidParameter,n)}return h&&(K="1 <> 1"),new c.a({parentfeatureset:y.associations,adaptedFields:[new c.IO(c.a.findField(y.associations.fields,Z)),new c.IO(c.a.findField(y.associations.fields,C)),v,X,M,P],extraFilter:K?A.A.create(K,{fieldsIndex:y.associations.getFieldsIndex(),timeZone:y.associations.dateFieldsTimeZoneDefaultUTC}):null})}))},e.signatures.push({name:"featuresetbyassociation",min:2,max:6}),e.functions.groupby=function(t,n){return e.standardFunctionAsync(t,n,(async(i,a,o)=>{if((0,d.D)(o,3,3,t,n),!(0,d.p)(o[0]))throw new s.D$(t,s.TX.InvalidParameter,n);const l=await o[0].load(),f=[],u=[];let c=!1,m=[];if((0,E.Kg)(o[1]))m.push(o[1]);else if(o[1]instanceof r.A)m.push(o[1]);else if((0,E.cy)(o[1]))m=o[1];else{if(!(0,d.m)(o[1]))throw new s.D$(t,s.TX.InvalidParameter,n);m=o[1].toArray()}for(const e of m)if((0,E.Kg)(e)){const t=A.A.create((0,d.f)(e),{fieldsIndex:l.getFieldsIndex(),timeZone:l.dateFieldsTimeZoneDefaultUTC}),n=!0===(0,g.DA)(t)?(0,d.f)(e):"%%%%FIELDNAME";f.push({name:n,expression:t}),"%%%%FIELDNAME"===n&&(c=!0)}else{if(!(e instanceof r.A))throw new s.D$(t,s.TX.InvalidParameter,n);{const i=e.hasField("name")?e.field("name"):"%%%%FIELDNAME",a=e.hasField("expression")?e.field("expression"):"";if("%%%%FIELDNAME"===i&&(c=!0),!i)throw new s.D$(t,s.TX.InvalidParameter,n);f.push({name:i,expression:A.A.create(a||i,{fieldsIndex:l.getFieldsIndex(),timeZone:l.dateFieldsTimeZoneDefaultUTC})})}}if(m=[],(0,E.Kg)(o[2]))m.push(o[2]);else if((0,E.cy)(o[2]))m=o[2];else if((0,d.m)(o[2]))m=o[2].toArray();else{if(!(o[2]instanceof r.A))throw new s.D$(t,s.TX.InvalidParameter,n);m.push(o[2])}for(const e of m){if(!(e instanceof r.A))throw new s.D$(t,s.TX.InvalidParameter,n);{const i=e.hasField("name")?e.field("name"):"",a=e.hasField("statistic")?e.field("statistic"):"",r=e.hasField("expression")?e.field("expression"):"";if(!i||!a||!r)throw new s.D$(t,s.TX.InvalidParameter,n);u.push({name:i,statistic:a.toLowerCase(),expression:A.A.create(r,{fieldsIndex:l.getFieldsIndex(),timeZone:l.dateFieldsTimeZoneDefaultUTC})})}}if(c){const e={};for(const t of l.fields)e[t.name.toLowerCase()]=1;for(const t of f)"%%%%FIELDNAME"!==t.name&&(e[t.name.toLowerCase()]=1);for(const t of u)"%%%%FIELDNAME"!==t.name&&(e[t.name.toLowerCase()]=1);let t=0;for(const n of f)if("%%%%FIELDNAME"===n.name){for(;1===e["field_"+t.toString()];)t++;e["field_"+t.toString()]=1,n.name="FIELD_"+t.toString()}}for(const n of f)N(n.expression,e,t);for(const n of u)N(n.expression,e,t);return o[0].groupby(f,u)}))},e.signatures.push({name:"groupby",min:3,max:3}),e.functions.distinct=function(t,n){return e.standardFunctionAsync(t,n,(async(i,a,o)=>{if((0,d.p)(o[0])){(0,d.D)(o,2,2,t,n);const i=await o[0].load(),a=[];let l=[];if((0,E.Kg)(o[1]))l.push(o[1]);else if(o[1]instanceof r.A)l.push(o[1]);else if((0,E.cy)(o[1]))l=o[1];else{if(!(0,d.m)(o[1]))throw new s.D$(t,s.TX.InvalidParameter,n);l=o[1].toArray()}let f=!1;for(const e of l)if((0,E.Kg)(e)){const t=A.A.create((0,d.f)(e),{fieldsIndex:i.getFieldsIndex(),timeZone:i.dateFieldsTimeZoneDefaultUTC}),n=!0===(0,g.DA)(t)?(0,d.f)(e):"%%%%FIELDNAME";a.push({name:n,expression:t}),"%%%%FIELDNAME"===n&&(f=!0)}else{if(!(e instanceof r.A))throw new s.D$(t,s.TX.InvalidParameter,n);{const r=e.hasField("name")?e.field("name"):"%%%%FIELDNAME",o=e.hasField("expression")?e.field("expression"):"";if("%%%%FIELDNAME"===r&&(f=!0),!r)throw new s.D$(t,s.TX.InvalidParameter,n);a.push({name:r,expression:A.A.create(o||r,{fieldsIndex:i.getFieldsIndex(),timeZone:i.dateFieldsTimeZoneDefaultUTC})})}}if(f){const e={};for(const t of i.fields)e[t.name.toLowerCase()]=1;for(const t of a)"%%%%FIELDNAME"!==t.name&&(e[t.name.toLowerCase()]=1);let t=0;for(const n of a)if("%%%%FIELDNAME"===n.name){for(;1===e["field_"+t.toString()];)t++;e["field_"+t.toString()]=1,n.name="FIELD_"+t.toString()}}for(const n of a)N(n.expression,e,t);return o[0].groupby(a,[])}return function(e){if(1===e.length){if((0,E.cy)(e[0]))return(0,F.t)("distinct",e[0],-1);if((0,d.m)(e[0]))return(0,F.t)("distinct",e[0].toArray(),-1)}return(0,F.t)("distinct",e,-1)}(o)}))},e.functions.getfeaturesetinfo=function(t,n){return e.standardFunctionAsync(t,n,(async(e,i,a)=>{if((0,d.D)(a,1,1,t,n),!(0,d.p)(a[0]))return null;const s=await a[0].getFeatureSetInfo();return s?r.A.convertObjectToArcadeDictionary({layerId:s.layerId,layerName:s.layerName,itemId:s.itemId,serviceLayerUrl:s.serviceLayerUrl,webMapLayerId:s.webMapLayerId??null,webMapLayerTitle:s.webMapLayerTitle??null,className:null,objectClassId:null},(0,d.L)(t),!1,!1):null}))},e.signatures.push({name:"getfeaturesetinfo",min:1,max:1}),e.functions.filterbysubtypecode=function(t,n){return e.standardFunctionAsync(t,n,(async(e,i,a)=>{if((0,d.D)(a,2,2,t,n),(0,d.p)(a[0])){const e=await a[0].load(),i=a[1];if(!(0,E.Fq)(i))throw new s.D$(t,s.TX.InvalidParameter,n);if(e.subtypeField){const t=A.A.create(`${e.subtypeField}= ${a[1]}`,{fieldsIndex:e.getFieldsIndex(),timeZone:e.dateFieldsTimeZoneDefaultUTC});return new m.A({parentfeatureset:a[0],whereclause:t})}if(null===e.typeIdField||""===e.typeIdField)throw new s.D$(t,s.TX.FeatureSetDoesNotHaveSubtypes,n);const r=A.A.create(`${e.typeIdField}= ${a[1]}`,{fieldsIndex:e.getFieldsIndex(),timeZone:e.dateFieldsTimeZoneDefaultUTC});return new m.A({parentfeatureset:a[0],whereclause:r})}throw new s.D$(t,s.TX.InvalidParameter,n)}))},e.signatures.push({name:"filterbysubtypecode",min:2,max:2}))}},80672:(e,t,n)=>{n.d(t,{R:()=>a});var i=n(20655);function a(e,t){return null===e?t:new i.A({url:e.field("url")})}}}]);
|