@arcgis/core 5.1.0-next.20 → 5.1.0-next.21
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/Components/OrientedImageryViewer/galleryUtils.d.ts +45 -15
- package/applications/Components/QuantityFormatter.d.ts +11 -11
- package/applications/Components/SelectionOperation.d.ts +11 -11
- package/applications/Components/SketchTooltipControls.d.ts +9 -9
- package/applications/Components/actionUtils.d.ts +2 -1
- package/applications/Components/analysisUtils.d.ts +27 -26
- package/applications/Components/applySetUtils.d.ts +40 -40
- package/applications/Components/arcadeEditorUtils.d.ts +3 -3
- package/applications/Components/arcadeFeatureUtils.d.ts +12 -12
- package/applications/Components/baUtils.d.ts +8 -8
- package/applications/Components/basemapUtils.d.ts +2 -2
- package/applications/Components/clipboard.d.ts +14 -14
- package/applications/Components/drawUtils.d.ts +3 -3
- package/applications/Components/editUtils.d.ts +14 -14
- package/applications/Components/featureUtils.d.ts +10 -10
- package/applications/Components/fieldFormatUtils.d.ts +2 -2
- package/applications/Components/fontUtils.d.ts +2 -2
- package/applications/Components/formatUtils.d.ts +2 -2
- package/applications/Components/getDefaultUnits.d.ts +2 -2
- package/applications/Components/gfxUtils.d.ts +5 -1
- package/applications/Components/imageryUtils.d.ts +35 -35
- package/applications/Components/layerOriginUtils.d.ts +5 -5
- package/applications/Components/layersEffectsJsonUtils.d.ts +2 -2
- package/applications/Components/previewSymbol2D.d.ts +2 -2
- package/applications/Components/rasterFunctionEditorUtils.d.ts +40 -40
- package/applications/Components/reactiveUtils.d.ts +14 -13
- package/applications/Components/sanitizerUtils.d.ts +2 -2
- package/applications/Components/stringUtils.d.ts +5 -5
- package/applications/Components/styleUtils.d.ts +2 -2
- package/applications/Components/svgUtils.d.ts +4 -4
- package/applications/Components/symbolUtils.d.ts +47 -11
- package/applications/Components/templateUtils.d.ts +73 -17
- package/applications/Components/templateUtils.js +1 -1
- package/applications/Components/testUtils.d.ts +3 -3
- package/applications/Components/unitUtils.d.ts +1 -1
- package/applications/Components/viewUtils.d.ts +2 -2
- package/applications/Components/webStyleSymbolUtils.d.ts +2 -2
- package/applications/Excalibur/imageryLayerUtils.d.ts +3 -3
- package/applications/Excalibur/videoViewUtils.d.ts +8 -8
- package/applications/Excalibur/widgetUtils.d.ts +2 -2
- package/applications/ExperienceBuilder/sketchUtils.d.ts +7 -7
- package/applications/KnowledgeStudio/dataModelVisualization.d.ts +20 -8
- package/applications/KnowledgeStudio/generalSdkInternalAccess.d.ts +21 -21
- package/applications/KnowledgeStudio/generalSharedKgUtils.d.ts +35 -35
- package/applications/KnowledgeStudio/layerInternalAccessUtils.d.ts +9 -9
- package/applications/KnowledgeStudio/reshape.d.ts +40 -40
- package/applications/KnowledgeStudio/resourceSerializationUtils.d.ts +11 -11
- package/applications/MapViewer/layerUtils.d.ts +2 -2
- package/applications/MapViewer/mediaUtils.d.ts +13 -13
- package/applications/MapViewer/templateUtils.d.ts +20 -20
- package/applications/PortalApp/layerUtils.d.ts +2 -2
- package/applications/SceneViewer/colorUtils.d.ts +2 -2
- package/applications/SceneViewer/devEnvironmentUtils.d.ts +4 -3
- package/applications/SceneViewer/layerUtils.d.ts +3 -3
- package/applications/SceneViewer/sceneViewerUtils.d.ts +34 -34
- package/applications/SceneViewer/symbolUtils.d.ts +2 -2
- package/applications/Urban/LineImagePattern3D.d.ts +3 -2
- package/applications/Urban/imagePatternUtils.d.ts +4 -4
- package/applications/Urban/meshUtils.d.ts +2 -2
- package/applications/WebEditor/sketchUtils.d.ts +8 -8
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{df321c37b61099f6e4c2.js → 11058e660139c427c3e7.js} +1 -1
- package/assets/esri/core/workers/chunks/1dcd057695f8db79eca2.js +1 -0
- package/assets/esri/core/workers/chunks/568d32ceee1409809e5a.js +1 -0
- package/assets/esri/core/workers/chunks/6b56c8ba978ec6edd6b8.js +1 -0
- package/assets/esri/core/workers/chunks/7b59ddad3c73f5f44b4d.js +1 -0
- package/assets/esri/core/workers/chunks/a4919dd9963f853a0077.js +1 -0
- package/assets/esri/core/workers/chunks/a7dbd38bc216713044fc.js +1 -0
- package/assets/esri/core/workers/chunks/{b8b2f160518e3a225d99.js → b364ec104dd59faa41b6.js} +1 -1
- package/assets/esri/core/workers/chunks/{0bb3beedae1b73beb1fc.js → b96dce64bdd7487e862a.js} +1 -1
- package/assets/esri/core/workers/chunks/{23c856265dd24ce54fdb.js → bfeab15d7ac9a2559fe5.js} +1 -1
- package/assets/esri/core/workers/chunks/c3e4f8664988e50bda55.js +1 -0
- package/assets/esri/core/workers/chunks/cf100c80b75ba74b479c.js +1 -0
- package/chunks/Clouds.glsl.js +1 -1
- package/config.js +1 -1
- package/geometry/support/curves/curveUtils.js +1 -1
- package/geometry/support/curves/densifyCurvedGeometry.js +1 -1
- package/graphic/graphicOriginUtils.js +1 -1
- package/kernel.js +1 -1
- package/layers/WMTSLayer.js +1 -1
- package/layers/graphics/editingSupport.js +1 -1
- package/layers/support/Sublayer.d.ts +3 -0
- package/package.json +1 -1
- package/renderers/support/DictionaryControlString.js +1 -1
- package/renderers/support/DictionaryLoader.js +1 -1
- package/rest/featureService/FeatureService.js +1 -1
- package/smartMapping/support/utils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMSymbolHelper.js +1 -1
- package/symbols/cim/GeometryWalker.js +1 -1
- package/symbols/cim/animationUtils.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/effects/EffectDashes.js +1 -1
- package/symbols/cim/effects/EffectDonut.js +1 -1
- package/symbols/cim/effects/EffectOffset.js +1 -1
- package/symbols/cim/effects/EffectWave.js +1 -1
- package/symbols/cim/placements/PlacementAlongLineSameSize.js +1 -1
- package/symbols/cim/placements/PlacementAtExtremities.js +1 -1
- package/symbols/cim/placements/PlacementAtRatioPositions.js +1 -1
- package/symbols/cim/placements/PlacementOnLine.js +1 -1
- package/symbols/cim/rasterizingUtils.js +1 -1
- package/symbols/cim/types.d.ts +220 -117
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/utils.js +1 -1
- package/views/3d/environment/CloudsRenderer.js +1 -1
- package/views/3d/environment/Fog.js +1 -1
- package/views/3d/environment/FogTechnique.js +1 -1
- package/views/3d/environment/NoiseTextureAtlas.js +1 -1
- package/views/3d/environment/NoiseTextureAtlasTechnique.js +1 -1
- package/views/3d/layers/graphics/polygonUtils.js +1 -1
- package/views/3d/layers/support/patternUtils.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/FBOCacheFormats.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
- package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/CutFillDepth.js +1 -1
- package/views/3d/webgl-engine/lib/GPUPointOcclusionQuery.js +1 -1
- package/views/3d/webgl-engine/lib/Geometry.js +1 -1
- package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
- package/views/3d/webgl-engine/lib/Material.js +1 -1
- package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
- package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/IndexBufferCache.js +2 -0
- package/views/3d/webgl-engine/materials/renderers/IndexLayout.js +2 -0
- package/views/3d/webgl-engine/materials/renderers/Instance.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedBuffer.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VaoRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
- package/views/View.d.ts +13 -2
- package/views/draw/support/Reshape.js +1 -1
- package/views/draw/support/reshapeUtils.js +1 -1
- package/views/draw/support/types.d.ts +8 -1
- package/views/interactive/support/utils.js +1 -1
- package/views/webgl/BufferObject.js +1 -1
- package/widgets/Attribution/AttributionViewModel.d.ts +3 -1
- package/widgets/Attribution/AttributionViewModel.js +1 -1
- package/widgets/Attribution.d.ts +1 -1
- package/widgets/Attribution.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/EditorViewModel.d.ts +2 -22
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/Workflow.js +1 -1
- package/widgets/Editor/support/SketchController.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.d.ts +10 -15
- package/widgets/Editor.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.d.ts +0 -15
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/support/types.d.ts +0 -1
- package/widgets/FeatureTable.d.ts +1 -19
- package/widgets/FeatureTable.js +1 -1
- package/widgets/HistogramRangeSlider.d.ts +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/MapViewAdapter.js +1 -1
- package/widgets/PanoramicVideoViewer.js +1 -1
- package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
- package/widgets/PanoramicViewer/support/PanoramicMedia.js +1 -1
- package/widgets/PanoramicViewer/support/PanoramicTileNode.js +1 -1
- package/widgets/PanoramicViewer/support/PanoramicTilePyramid.js +1 -1
- package/widgets/PanoramicViewer/utils.js +1 -1
- package/widgets/Sketch/SketchViewModel.d.ts +4 -22
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch/support/PluginManager.js +1 -1
- package/widgets/Sketch.d.ts +10 -17
- package/widgets/Sketch.js +1 -1
- package/assets/esri/core/workers/chunks/0d56e3b3265a4470aaa6.js +0 -1
- package/assets/esri/core/workers/chunks/5a8b3e5977c233d5c9d0.js +0 -1
- package/assets/esri/core/workers/chunks/bbf2afa05314e267893f.js +0 -1
- package/assets/esri/core/workers/chunks/bd2f577cae61facdde4a.js +0 -1
- package/assets/esri/core/workers/chunks/bf2bfc0d78be8c185d58.js +0 -1
- package/assets/esri/core/workers/chunks/c6e0ada6f2ad74fddfec.js +0 -1
- package/assets/esri/core/workers/chunks/dcc8363faa22e6211351.js +0 -1
- package/assets/esri/core/workers/chunks/e081d6f21a2c01ccaf61.js +0 -1
package/widgets/Sketch.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{isSome as o}from"../core/arrayUtils.js";import{deprecateWidget as i}from"../core/deprecate.js";import{handlesGroup as l}from"../core/handleUtils.js";import s from"../core/Logger.js";import{removeMaybe as n,destroyMaybe as r}from"../core/maybe.js";import{ignoreAbortErrors as a}from"../core/promiseUtils.js";import{watch as p,syncAndInitial as c,when as d}from"../core/reactiveUtils.js";import{property as u,subclass as h}from"../core/accessorSupport/decorators.js";import{symbolTypes as v}from"../symbols/support/typeUtils.js";import m from"../views/interactive/sketch/SketchLabelOptions.js";import g from"../views/interactive/sketch/SketchTooltipOptions.js";import y from"../views/interactive/sketch/SketchValueOptions.js";import f from"./Widget.js";import b from"./Sketch/SketchViewModel.js";import _ from"./Sketch/VisibleElements.js";import w from"./Sketch/support/ResponsiveToolbar/ResponsiveToolbar.js";import{loadCalciteComponents as T}from"./support/componentsUtils.js";import M from"./support/SelectionToolbar.js";import C from"./support/SketchTooltipControls.js";import S from"./support/SnappingControls.js";import{tsx as O,messageBundle as k,vmEvent as P}from"./support/widget.js";import I from"./support/SelectionToolbar/VisibleElements.js";import L from"./support/SketchTooltipControls/VisibleElements.js";const x="esri-sketch",E={base:x,vertical:`${x}--vertical`,docked:`${x}-bar`,floating:`${x}-pad`,chipHorizontal:`${x}__selection-count-chip--horizontal`,chipVertical:`${x}__selection-count-chip--vertical`,chipVerticalSmall:`${x}__selection-count-chip--vertical--s`,popoverWrapper:`${x}__popover-wrapper`},R={point:"pin",polyline:"line",polygon:"polygon",rectangle:"rectangle",circle:"circle",multipoint:"pins",mesh:"i3d-building",freehandPolygon:"freehand-area",freehandPolyline:"freehand",text:"add-text"};let G=class extends f{constructor(e,t){super(e,t),this._selectionToolbar=null,this._viewModelHandlesGroup=null,this._popoverElement=null,this.availableCreateTools=["point","polyline","polygon","rectangle","circle"],this.customToolOptions=null,this.customActions=null,this.toolbarKind="floating",this.contextualToolLocation="separate",this.groupCollapsePriorities=null,this.groupAllowCollapseOptions=null,this.messages=null,this.messagesCommon=null,this.visibleElements=new _,this._defaultViewModel=null,this._activeCustomToolOptions=null,this._calcitePopoverReferenceElement=null,this._relativeLocation="top",this._popoverOpen=!1,!0!==e?.suppressDeprecationWarning&&(this.announceDeprecation=()=>{i(s.getLogger(this),"Sketch","arcgis-sketch",{version:"5.0"})}),this._activateCreateTool=this._activateCreateTool.bind(this),this.viewModel=e?.viewModel||(this._defaultViewModel=new b({creationMode:e?.creationMode??"continuous",useLegacyCreateTools:e?.useLegacyCreateTools??"2d"!==e?.view?.type}))}normalizeCtorArgs(e={}){const{suppressDeprecationWarning:t,...o}=e;return o}initialize(){const{layer:e,view:t}=this,o="2d"===t?.type,i=new M({persistSelection:!1,visibleElements:new I({chip:!1,lassoTool:o,operationTypeControls:!1,pan:!1,pointTool:!1,rectangleTool:o}),view:t,sources:e?[e]:null,scale:this.scale});this.addHandles([p(()=>this.viewModel,e=>{this._viewModelHandlesGroup=n(this._viewModelHandlesGroup),e&&(this._viewModelHandlesGroup=l([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()),p(()=>e.layer,e=>{this._selectionToolbar&&(this._selectionToolbar.sources=e?[e]:null)}),p(()=>e.view,e=>{this._selectionToolbar&&(this._selectionToolbar.view=e)}),p(()=>e.state,()=>this.notifyChange("state"))]))},c),d(()=>i.activeOperation,()=>{this.viewModel.cancel(),this._activeCustomToolOptions=null}),i.on("complete",e=>this._onSelectionOperationComplete(e)),p(()=>{const{view:e,visibleElements:{selectionTools:t}}=this;return{lassoTool:"3d"!==e?.type&&!!t?.["lasso-selection"],rectangleTool:"3d"!==e?.type&&!!t?.["rectangle-selection"]}},e=>{Object.assign(i.visibleElements,e)},c)]),this._selectionToolbar=i}loadDependencies(){return T({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=n(this._viewModelHandlesGroup)}get activeTool(){const e=this._selectionToolbar?.activeOperation;if(e)switch(e.toolName){case"lasso":return"lasso-selection";case"rectangle":return"rectangle-selection";case"default":return"custom-selection"}const{availableCreateTools:t}=this,{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)}get pointSymbol(){return this.viewModel.pointSymbol}set pointSymbol(e){this.viewModel.pointSymbol=e}get polygonSymbol(){return this.viewModel.polygonSymbol}set polygonSymbol(e){this.viewModel.polygonSymbol=e}get polylineSymbol(){return this.viewModel.polylineSymbol}set polylineSymbol(e){this.viewModel.polylineSymbol=e}get textSymbol(){return this.viewModel.textSymbol}set textSymbol(e){this.viewModel.textSymbol=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?.activeOperation?"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&&r(t),t?.pluginManager?.sketch===this&&(t.pluginManager.sketch=null),this._set("viewModel",e),e.addHandles(p(()=>e.pluginManager,e=>{e&&(e.sketch=this)},c)))}get useLegacyCreateTools(){return this.viewModel.useLegacyCreateTools}set useLegacyCreateTools(e){this._set("useLegacyCreateTools",e)}get isUsingLegacyCreateTools(){return this.viewModel.isUsingLegacyCreateTools}get _effectiveAvailableCreateTools(){if(this.viewModel.effectiveAvailablePlugins?.length)return this.viewModel.effectiveAvailablePlugins;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,a(this.viewModel.create(e,i))}update(e,t){return a(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;return O("div",null,O("div",{classes:{[E.base]:!0,[E.floating]:"floating"===e,[E.docked]:"docked"===e,[E.vertical]:"vertical"===t}},O(w,{barStyle:e,layout:t,scale:o},this._renderSelectionSetItemGroupInline(),this._renderSelectionToolsOrBack(),this._renderCreateToolActionGroup(),this._renderUndoRedoMenuItemGroup(),this._renderSettingsMenuItemGroup()),this._renderSelectionSetToolbar(),this._renderSettingsMenuPopover()))}_renderSelectionToolsOrBack(){if(!this.viewModel.isUsingLegacyCreateTools&&this.viewModel.firstPluginWithSwappableLeaf)return this._renderBackButton();const e=this.customActions?.filter(e=>"selection-toolbar"===e.position);return O("div",{"allow-collapse":this.groupAllowCollapseOptions?.get("selectionTools")??!0,"group-kind":"split-button",key:"selection-split-button",priority:this.groupCollapsePriorities?.get("selectionTools")??0},this._renderDefaultSelectionButton(),this._selectionToolbar?.render(),e?.map(e=>this._renderToolbarItem(e)))}_renderSettingsMenuPopover(){const{messagesCommon:e,snappingOptions:t,view:o,viewModel:i,visibleElements:l}=this;if(!this._calcitePopoverReferenceElement)return;const s={directionModePicker:l.directionModePicker,labelsToggle:l.labelsToggle,tooltipsToggle:l.tooltipsToggle},n="horizontal"===this.layout?"top"===this._relativeLocation?"bottom-end":"top-end":"right-end";return O("calcite-popover",{afterCreate:e=>this._popoverElement=e,closable:!0,heading:e.settings,label:e.settings,open:this._popoverOpen,overlayPositioning:"fixed",placement:n,referenceElement:this._calcitePopoverReferenceElement,scale:this.scale,topLayerDisabled:this.topLayerDisabled,onCalcitePopoverBeforeClose:e=>this._beforePopoverClose(e.target),onCalcitePopoverBeforeOpen:e=>this._remeasurePopoverSizes(e.currentTarget),onCalcitePopoverClose:e=>this._refocusOnView(e.target)},O("div",{class:E.popoverWrapper},Object.values(s).includes(!0)?O(C,{sketchOptions:i.sketchOptions,viewType:o?.type,visibleElements:new L(s)}):void 0,l.snappingControls&&o&&t?O(S,{snappingManager:this.viewModel.snappingManager,snappingOptions:t,view:o,visibleElements:l.snappingControlsElements}):void 0))}_beforePopoverClose(e){e===this._popoverElement&&(this._popoverOpen=!1)}_renderSelectionSetToolbar(){if("separate"!==this.contextualToolLocation)return;const e=this._renderSelectionSetItemGroup();return e?.length?O(w,{barStyle:this.toolbarKind,layout:this.layout,scale:this.scale},e):void 0}_renderSelectionSetItemGroupInline(){return"separate"===this.contextualToolLocation?[]:this._renderSelectionSetItemGroup()}_renderUndoRedoMenuItemGroup(){return O("div",{"allow-collapse":this.groupAllowCollapseOptions?.get("undoRedo")??!0,"group-kind":"split-button",key:"undo-redo-menu",priority:this.groupCollapsePriorities?.get("undoRedo")??10,slot:"actions-end"},this._renderUndoButton(),this._renderRedoButton())}_renderSettingsMenuItemGroup(){const e=[],t=[];this.customActions?.forEach(o=>{"settings-before"===o.position?t.push(o):"settings-after"===o.position&&e.push(o)});const i=[...t.map(e=>this._renderToolbarItem(e)),this._renderSettingsMenuButton(),...e.map(e=>this._renderToolbarItem(e))].filter(o);if(i.length)return O("div",{"allow-collapse":this.groupAllowCollapseOptions?.get("settings")??!1,"group-kind":"overflow-group",key:"settings-menu",priority:this.groupCollapsePriorities?.get("settings")??1e3,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")??100;return[O("div",{"group-kind":"measured-content",key:"selection-count-chip-group",priority:i,slot:e},this._renderFeatureCountChip()),O("div",{"allow-collapse":this.groupAllowCollapseOptions?.get("selectionSet")??!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})}_renderBackButton(){const{viewModel:e,isUsingLegacyCreateTools:t}=this;if(!t&&e.multiplePluginsActive&&e.firstPluginWithSwappableLeaf&&e.rootPlugins&&!(e.rootPlugins.length<2&&e.rootPlugins.includes(e.firstPluginWithSwappableLeaf)))return O("div",{"allow-collapse":!1,"group-kind":"overflow-group",key:"back-button-group"},O("calcite-action",{icon:"chevron-left",onclick:()=>{this.viewModel?.cancel()},scale:this.scale,text:this.messagesCommon.back}))}_renderCreateToolActionGroup(){const e=this.customToolOptions?.flatMap(e=>this._renderCustomToolItem(e))??[],t=this._effectiveAvailableCreateTools,o=t?.filter(e=>"string"==typeof e),i=o?.map(e=>this._renderCreateToolItem(e)),l=t?.filter(e=>"string"!=typeof e).map(e=>this._renderCreateToolItem(e));return[i?.length||e?.length||l?.length?O("div",{"allow-collapse":this.groupAllowCollapseOptions?.get("createTools")??!0,"group-kind":"overflow-group",key:"create-tools-group",priority:this.groupCollapsePriorities?.get("createTools")??100},i,e,l):void 0]}_renderCreateToolItem(e){return"string"==typeof e?this._renderBuiltInCreateToolItem(e):this._renderDrawToolPluginItem(e)}_renderDrawToolPluginItem(e){const{icon:t,localizationKey:o,uniqueId:i,hidden:l}=e;if(l)return[];const s=this.messages.digitizers,n=s?.[o]??o,r=this.viewModel.drawTool?.pluginStack.some(e=>!e.configuration?.hidden&&e.configuration?.uniqueId===i);return this._renderToolbarItem({id:`${o}-button`,text:n,icon:t,onclick:()=>this._activatePlugin([e]),active:r})}_renderBuiltInCreateToolItem(e){return this._renderToolbarItem({id:`${e}-button`,text:this.messages.draw[e],icon:R[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:o,scale:i,id:l,updateGraphics:{length:s}}=this,n=t(o.selectedCount,{count:s}),r="l"===i?999:99,a=s>r?t(o.selectedCountTruncated,{truncated:r}):s,p="l"!==i&&"vertical"===e,c=p?`${l}-selection-chip-small`:`${l}-selection-chip`;return[p?O("span",{classes:{[E.chipVertical]:!0,[E.chipVerticalSmall]:"s"===this.scale},id:c,tabIndex:0,title:n},a):O("calcite-chip",{appearance:"outline",class:"horizontal"===e?E.chipHorizontal:E.chipVertical,id:c,kind:"brand",label:n,scale:"l"===i?"m":"s",tabIndex:0,title:"vertical"===e?n:void 0},"vertical"===e?a:n)]}_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:l,active:s,flipRTL:n,afterCreate:r,afterUpdate:a,afterRemoved:p}){const c=`${this.id}-${e}`;return[O("calcite-action",{active:s,afterCreate:r,afterRemoved:p,afterUpdate:a,bind:this,"data-testid":e,disabled:i||"disabled"===this.state,icon:o,iconFlipRtl:n??!1,id:c,key:e,onclick:l,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 l=this._calcitePopoverReferenceElement;if(!l)return;const{bottom:s,top:n}=l.getBoundingClientRect();if("horizontal"===this.layout){const e=s<o.height/2;e!==("top"===this._relativeLocation)&&(this._relativeLocation=e?"top":"bottom"),e?(i?.setProperty("--sketch-view-height-offset",s-o.top+"px"),i?.setProperty("--sketch-view-margin-offset","30px")):(i?.setProperty("--sketch-view-height-offset",o.bottom-n+"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 r=e.shadowRoot?.querySelector("div.header")?.getBoundingClientRect().height;i.setProperty("--sketch-popover-header-offset",`${r}px`)}catch(t){s.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)}_activatePlugin(e){this._selectionToolbar?.cancel(),this.viewModel.firstPluginWithSwappableLeaf?(this.viewModel.drawTool?.replaceLeaf(e),this.view?.ready&&this.view.focus()):this._activateCreateTool(e)}_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(e){this.activeTool&&e===this._popoverElement&&this.view?.focus()}};e([u()],G.prototype,"activeTool",null),e([u({readOnly:!0})],G.prototype,"activeTooltip",null),e([u({cast:e=>{if(!e?.length)return null;const t=new Set(["point","polyline","polygon","rectangle","circle","multipoint","freehandPolyline","freehandPolygon","mesh","text"]);return e.filter(e=>t.has(e))}})],G.prototype,"availableCreateTools",void 0),e([u({readOnly:!0})],G.prototype,"createGraphic",null),e([u()],G.prototype,"creationMode",null),e([u()],G.prototype,"customToolOptions",void 0),e([u()],G.prototype,"customActions",void 0),e([u()],G.prototype,"defaultCreateOptions",null),e([u()],G.prototype,"defaultUpdateOptions",null),e([u()],G.prototype,"icon",null),e([u()],G.prototype,"label",null),e([u({type:m})],G.prototype,"labelOptions",null),e([u()],G.prototype,"layer",null),e([u({type:["horizontal","vertical"],value:"horizontal"})],G.prototype,"layout",null),e([u({types:v})],G.prototype,"pointSymbol",null),e([u({types:v})],G.prototype,"polygonSymbol",null),e([u({types:v})],G.prototype,"polylineSymbol",null),e([u()],G.prototype,"textSymbol",null),e([u({value:"m"})],G.prototype,"scale",null),e([u()],G.prototype,"toolbarKind",void 0),e([u()],G.prototype,"contextualToolLocation",void 0),e([u()],G.prototype,"groupCollapsePriorities",void 0),e([u()],G.prototype,"groupAllowCollapseOptions",void 0),e([u(),k("esri/widgets/Sketch/t9n/Sketch")],G.prototype,"messages",void 0),e([u(),k("esri/t9n/common")],G.prototype,"messagesCommon",void 0),e([u()],G.prototype,"snappingOptions",null),e([u()],G.prototype,"state",null),e([u({type:g})],G.prototype,"tooltipOptions",null),e([u({readOnly:!0})],G.prototype,"updateGraphics",null),e([u({type:y,nonNullable:!0})],G.prototype,"valueOptions",null),e([u()],G.prototype,"view",null),e([u({type:b}),P(["create","update","undo","redo"])],G.prototype,"viewModel",null),e([u({type:_,nonNullable:!0})],G.prototype,"visibleElements",void 0),e([u({constructOnly:!0,value:!1})],G.prototype,"useLegacyCreateTools",null),e([u()],G.prototype,"isUsingLegacyCreateTools",null),e([u()],G.prototype,"_effectiveAvailableCreateTools",null),e([u()],G.prototype,"_defaultViewModel",void 0),e([u()],G.prototype,"_activeCustomToolOptions",void 0),e([u()],G.prototype,"_calcitePopoverReferenceElement",void 0),e([u()],G.prototype,"_relativeLocation",void 0),e([u()],G.prototype,"_popoverOpen",void 0),G=e([h("esri.widgets.Sketch")],G);const B=G;export{B as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{isSome as o}from"../core/arrayUtils.js";import{deprecateWidget as i}from"../core/deprecate.js";import{handlesGroup as l}from"../core/handleUtils.js";import s from"../core/Logger.js";import{removeMaybe as n,destroyMaybe as r}from"../core/maybe.js";import{ignoreAbortErrors as a}from"../core/promiseUtils.js";import{watch as p,syncAndInitial as c,when as d}from"../core/reactiveUtils.js";import{property as u,subclass as h}from"../core/accessorSupport/decorators.js";import{symbolTypes as v}from"../symbols/support/typeUtils.js";import m from"../views/interactive/sketch/SketchLabelOptions.js";import g from"../views/interactive/sketch/SketchTooltipOptions.js";import y from"../views/interactive/sketch/SketchValueOptions.js";import f from"./Widget.js";import b from"./Sketch/SketchViewModel.js";import w from"./Sketch/VisibleElements.js";import _ from"./Sketch/support/ResponsiveToolbar/ResponsiveToolbar.js";import{loadCalciteComponents as T}from"./support/componentsUtils.js";import M from"./support/SelectionToolbar.js";import C from"./support/SketchTooltipControls.js";import S from"./support/SnappingControls.js";import{tsx as O,messageBundle as k,vmEvent as P}from"./support/widget.js";import I from"./support/SelectionToolbar/VisibleElements.js";import L from"./support/SketchTooltipControls/VisibleElements.js";const x="esri-sketch",E={base:x,vertical:`${x}--vertical`,docked:`${x}-bar`,floating:`${x}-pad`,chipHorizontal:`${x}__selection-count-chip--horizontal`,chipVertical:`${x}__selection-count-chip--vertical`,chipVerticalSmall:`${x}__selection-count-chip--vertical--s`,popoverWrapper:`${x}__popover-wrapper`},R={point:"pin",polyline:"line",polygon:"polygon",rectangle:"rectangle",circle:"circle",multipoint:"pins",mesh:"i3d-building",freehandPolygon:"freehand-area",freehandPolyline:"freehand",text:"add-text"};let G=class extends f{constructor(e,t){super(e,t),this._selectionToolbar=null,this._viewModelHandlesGroup=null,this._popoverElement=null,this.availableCreateTools=["point","polyline","polygon","rectangle","circle"],this.customToolOptions=null,this.customActions=null,this.toolbarKind="floating",this.contextualToolLocation="separate",this.groupCollapsePriorities=null,this.groupAllowCollapseOptions=null,this.messages=null,this.messagesCommon=null,this.visibleElements=new w,this._defaultViewModel=null,this._activeCustomToolOptions=null,this._calcitePopoverReferenceElement=null,this._relativeLocation="top",this._popoverOpen=!1,!0!==e?.suppressDeprecationWarning&&(this.announceDeprecation=()=>{i(s.getLogger(this),"Sketch","arcgis-sketch",{version:"5.0"})}),this._activateCreateTool=this._activateCreateTool.bind(this),this.viewModel=e?.viewModel||(this._defaultViewModel=new b({creationMode:e?.creationMode??"continuous",useLegacyCreateTools:e?.useLegacyCreateTools??"2d"!==e?.view?.type})),this.viewModel.pluginManager.sketch=this}normalizeCtorArgs(e={}){const{suppressDeprecationWarning:t,...o}=e;return o}initialize(){const{layer:e,view:t}=this,o="2d"===t?.type,i=new M({persistSelection:!1,visibleElements:new I({chip:!1,lassoTool:o,operationTypeControls:!1,pan:!1,pointTool:!1,rectangleTool:o}),view:t,sources:e?[e]:null,scale:this.scale});this.addHandles([p(()=>this.viewModel,e=>{this._viewModelHandlesGroup=n(this._viewModelHandlesGroup),e&&(this._viewModelHandlesGroup=l([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()),p(()=>e.layer,e=>{this._selectionToolbar&&(this._selectionToolbar.sources=e?[e]:null)}),p(()=>e.view,e=>{this._selectionToolbar&&(this._selectionToolbar.view=e)}),p(()=>e.state,()=>this.notifyChange("state"))]))},c),d(()=>i.activeOperation,()=>{this.viewModel.cancel(),this._activeCustomToolOptions=null}),i.on("complete",e=>this._onSelectionOperationComplete(e)),p(()=>{const{view:e,visibleElements:{selectionTools:t}}=this;return{lassoTool:"3d"!==e?.type&&!!t?.["lasso-selection"],rectangleTool:"3d"!==e?.type&&!!t?.["rectangle-selection"]}},e=>{Object.assign(i.visibleElements,e)},c)]),this._selectionToolbar=i}loadDependencies(){return T({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=n(this._viewModelHandlesGroup)}get activeTool(){const e=this._selectionToolbar?.activeOperation;if(e)switch(e.toolName){case"lasso":return"lasso-selection";case"rectangle":return"rectangle-selection";case"default":return"custom-selection"}const{availableCreateTools:t}=this,{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)}get pointSymbol(){return this.viewModel.pointSymbol}set pointSymbol(e){this.viewModel.pointSymbol=e}get polygonSymbol(){return this.viewModel.polygonSymbol}set polygonSymbol(e){this.viewModel.polygonSymbol=e}get polylineSymbol(){return this.viewModel.polylineSymbol}set polylineSymbol(e){this.viewModel.polylineSymbol=e}get textSymbol(){return this.viewModel.textSymbol}set textSymbol(e){this.viewModel.textSymbol=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?.activeOperation?"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&&r(t),t?.pluginManager?.sketch===this&&(t.pluginManager.sketch=null),this._set("viewModel",e),e.pluginManager.sketch=this)}get useLegacyCreateTools(){return this.viewModel.useLegacyCreateTools}set useLegacyCreateTools(e){this.viewModel.useLegacyCreateTools=e}get isUsingLegacyCreateTools(){return this.viewModel.isUsingLegacyCreateTools}get _effectiveAvailableCreateTools(){if(this.viewModel.effectiveAvailablePlugins?.length)return this.viewModel.effectiveAvailablePlugins;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,a(this.viewModel.create(e,i))}update(e,t){return a(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;return O("div",null,O("div",{classes:{[E.base]:!0,[E.floating]:"floating"===e,[E.docked]:"docked"===e,[E.vertical]:"vertical"===t}},O(_,{barStyle:e,layout:t,scale:o},this._renderSelectionSetItemGroupInline(),this._renderSelectionToolsOrBack(),this._renderCreateToolActionGroup(),this._renderUndoRedoMenuItemGroup(),this._renderSettingsMenuItemGroup()),this._renderSelectionSetToolbar(),this._renderSettingsMenuPopover()))}_renderSelectionToolsOrBack(){if(!this.viewModel.isUsingLegacyCreateTools&&this.viewModel.firstPluginWithSwappableLeaf)return this._renderBackButton();const e=this.customActions?.filter(e=>"selection-toolbar"===e.position);return O("div",{"allow-collapse":this.groupAllowCollapseOptions?.get("selectionTools")??!0,"group-kind":"split-button",key:"selection-split-button",priority:this.groupCollapsePriorities?.get("selectionTools")??0},this._renderDefaultSelectionButton(),this._selectionToolbar?.render(),e?.map(e=>this._renderToolbarItem(e)))}_renderSettingsMenuPopover(){const{messagesCommon:e,snappingOptions:t,view:o,viewModel:i,visibleElements:l}=this;if(!this._calcitePopoverReferenceElement)return;const s={directionModePicker:l.directionModePicker,labelsToggle:l.labelsToggle,tooltipsToggle:l.tooltipsToggle},n="horizontal"===this.layout?"top"===this._relativeLocation?"bottom-end":"top-end":"right-end";return O("calcite-popover",{afterCreate:e=>this._popoverElement=e,closable:!0,heading:e.settings,label:e.settings,open:this._popoverOpen,overlayPositioning:"fixed",placement:n,referenceElement:this._calcitePopoverReferenceElement,scale:this.scale,topLayerDisabled:this.topLayerDisabled,onCalcitePopoverBeforeClose:e=>this._beforePopoverClose(e.target),onCalcitePopoverBeforeOpen:e=>this._remeasurePopoverSizes(e.currentTarget),onCalcitePopoverClose:e=>this._refocusOnView(e.target)},O("div",{class:E.popoverWrapper},Object.values(s).includes(!0)?O(C,{sketchOptions:i.sketchOptions,viewType:o?.type,visibleElements:new L(s)}):void 0,l.snappingControls&&o&&t?O(S,{snappingManager:this.viewModel.snappingManager,snappingOptions:t,view:o,visibleElements:l.snappingControlsElements}):void 0))}_beforePopoverClose(e){e===this._popoverElement&&(this._popoverOpen=!1)}_renderSelectionSetToolbar(){if("separate"!==this.contextualToolLocation)return;const e=this._renderSelectionSetItemGroup();return e?.length?O(_,{barStyle:this.toolbarKind,layout:this.layout,scale:this.scale},e):void 0}_renderSelectionSetItemGroupInline(){return"separate"===this.contextualToolLocation?[]:this._renderSelectionSetItemGroup()}_renderUndoRedoMenuItemGroup(){return O("div",{"allow-collapse":this.groupAllowCollapseOptions?.get("undoRedo")??!0,"group-kind":"split-button",key:"undo-redo-menu",priority:this.groupCollapsePriorities?.get("undoRedo")??10,slot:"actions-end"},this._renderUndoButton(),this._renderRedoButton())}_renderSettingsMenuItemGroup(){const e=[],t=[];this.customActions?.forEach(o=>{"settings-before"===o.position?t.push(o):"settings-after"===o.position&&e.push(o)});const i=[...t.map(e=>this._renderToolbarItem(e)),this._renderSettingsMenuButton(),...e.map(e=>this._renderToolbarItem(e))].filter(o);if(i.length)return O("div",{"allow-collapse":this.groupAllowCollapseOptions?.get("settings")??!1,"group-kind":"overflow-group",key:"settings-menu",priority:this.groupCollapsePriorities?.get("settings")??1e3,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")??100;return[O("div",{"group-kind":"measured-content",key:"selection-count-chip-group",priority:i,slot:e},this._renderFeatureCountChip()),O("div",{"allow-collapse":this.groupAllowCollapseOptions?.get("selectionSet")??!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})}_renderBackButton(){const{viewModel:e,isUsingLegacyCreateTools:t}=this;if(!t&&e.multiplePluginsActive&&e.firstPluginWithSwappableLeaf&&e.rootPlugins&&!(e.rootPlugins.length<2&&e.rootPlugins.includes(e.firstPluginWithSwappableLeaf)))return O("div",{"allow-collapse":!1,"group-kind":"overflow-group",key:"back-button-group"},O("calcite-action",{icon:"chevron-left",onclick:()=>{this.viewModel?.cancel()},scale:this.scale,text:this.messagesCommon.back}))}_renderCreateToolActionGroup(){const e=this.customToolOptions?.flatMap(e=>this._renderCustomToolItem(e))??[],t=this._effectiveAvailableCreateTools,o=t?.filter(e=>"string"==typeof e),i=o?.map(e=>this._renderCreateToolItem(e)),l=t?.filter(e=>"string"!=typeof e).map(e=>this._renderCreateToolItem(e));return[i?.length||e?.length||l?.length?O("div",{"allow-collapse":this.groupAllowCollapseOptions?.get("createTools")??!0,"group-kind":"overflow-group",key:"create-tools-group",priority:this.groupCollapsePriorities?.get("createTools")??100},i,e,l):void 0]}_renderCreateToolItem(e){return"string"==typeof e?this._renderBuiltInCreateToolItem(e):this._renderDrawToolPluginItem(e)}_renderDrawToolPluginItem(e){const{icon:t,localizationKey:o,uniqueId:i,hidden:l}=e;if(l)return[];const s=this.messages.digitizers,n=s?.[o]??o,r=this.viewModel.drawTool?.pluginStack.some(e=>!e.configuration?.hidden&&e.configuration?.uniqueId===i);return this._renderToolbarItem({id:`${o}-button`,text:n,icon:t,onclick:()=>this._activatePlugin([e]),active:r})}_renderBuiltInCreateToolItem(e){return this._renderToolbarItem({id:`${e}-button`,text:this.messages.draw[e],icon:R[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:o,scale:i,id:l,updateGraphics:{length:s}}=this,n=t(o.selectedCount,{count:s}),r="l"===i?999:99,a=s>r?t(o.selectedCountTruncated,{truncated:r}):s,p="l"!==i&&"vertical"===e,c=p?`${l}-selection-chip-small`:`${l}-selection-chip`;return[p?O("span",{classes:{[E.chipVertical]:!0,[E.chipVerticalSmall]:"s"===this.scale},id:c,tabIndex:0,title:n},a):O("calcite-chip",{appearance:"outline",class:"horizontal"===e?E.chipHorizontal:E.chipVertical,id:c,kind:"brand",label:n,scale:"l"===i?"m":"s",tabIndex:0,title:"vertical"===e?n:void 0},"vertical"===e?a:n)]}_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:l,active:s,flipRTL:n,afterCreate:r,afterUpdate:a,afterRemoved:p}){const c=`${this.id}-${e}`;return[O("calcite-action",{active:s,afterCreate:r,afterRemoved:p,afterUpdate:a,bind:this,"data-testid":e,disabled:i||"disabled"===this.state,icon:o,iconFlipRtl:n??!1,id:c,key:e,onclick:l,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 l=this._calcitePopoverReferenceElement;if(!l)return;const{bottom:s,top:n}=l.getBoundingClientRect();if("horizontal"===this.layout){const e=s<o.height/2;e!==("top"===this._relativeLocation)&&(this._relativeLocation=e?"top":"bottom"),e?(i?.setProperty("--sketch-view-height-offset",s-o.top+"px"),i?.setProperty("--sketch-view-margin-offset","30px")):(i?.setProperty("--sketch-view-height-offset",o.bottom-n+"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 r=e.shadowRoot?.querySelector("div.header")?.getBoundingClientRect().height;i.setProperty("--sketch-popover-header-offset",`${r}px`)}catch(t){s.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)}_activatePlugin(e){this._selectionToolbar?.cancel(),this.viewModel.firstPluginWithSwappableLeaf?(this.viewModel.drawTool?.replaceLeaf(e),this.view?.ready&&this.view.focus()):this._activateCreateTool(e)}_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(e){this.activeTool&&e===this._popoverElement&&this.view?.focus()}};e([u()],G.prototype,"activeTool",null),e([u({readOnly:!0})],G.prototype,"activeTooltip",null),e([u({cast:e=>{if(!e?.length)return null;const t=new Set(["point","polyline","polygon","rectangle","circle","multipoint","freehandPolyline","freehandPolygon","mesh","text"]);return e.filter(e=>t.has(e))}})],G.prototype,"availableCreateTools",void 0),e([u({readOnly:!0})],G.prototype,"createGraphic",null),e([u()],G.prototype,"creationMode",null),e([u()],G.prototype,"customToolOptions",void 0),e([u()],G.prototype,"customActions",void 0),e([u()],G.prototype,"defaultCreateOptions",null),e([u()],G.prototype,"defaultUpdateOptions",null),e([u()],G.prototype,"icon",null),e([u()],G.prototype,"label",null),e([u({type:m})],G.prototype,"labelOptions",null),e([u()],G.prototype,"layer",null),e([u({type:["horizontal","vertical"],value:"horizontal"})],G.prototype,"layout",null),e([u({types:v})],G.prototype,"pointSymbol",null),e([u({types:v})],G.prototype,"polygonSymbol",null),e([u({types:v})],G.prototype,"polylineSymbol",null),e([u()],G.prototype,"textSymbol",null),e([u({value:"m"})],G.prototype,"scale",null),e([u()],G.prototype,"toolbarKind",void 0),e([u()],G.prototype,"contextualToolLocation",void 0),e([u()],G.prototype,"groupCollapsePriorities",void 0),e([u()],G.prototype,"groupAllowCollapseOptions",void 0),e([u(),k("esri/widgets/Sketch/t9n/Sketch")],G.prototype,"messages",void 0),e([u(),k("esri/t9n/common")],G.prototype,"messagesCommon",void 0),e([u()],G.prototype,"snappingOptions",null),e([u()],G.prototype,"state",null),e([u({type:g})],G.prototype,"tooltipOptions",null),e([u({readOnly:!0})],G.prototype,"updateGraphics",null),e([u({type:y,nonNullable:!0})],G.prototype,"valueOptions",null),e([u()],G.prototype,"view",null),e([u({type:b}),P(["create","update","undo","redo"])],G.prototype,"viewModel",null),e([u({type:w,nonNullable:!0})],G.prototype,"visibleElements",void 0),e([u()],G.prototype,"useLegacyCreateTools",null),e([u()],G.prototype,"isUsingLegacyCreateTools",null),e([u()],G.prototype,"_effectiveAvailableCreateTools",null),e([u()],G.prototype,"_defaultViewModel",void 0),e([u()],G.prototype,"_activeCustomToolOptions",void 0),e([u()],G.prototype,"_calcitePopoverReferenceElement",void 0),e([u()],G.prototype,"_relativeLocation",void 0),e([u()],G.prototype,"_popoverOpen",void 0),G=e([h("esri.widgets.Sketch")],G);const B=G;export{B as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[309],{20309(e,t,i){i.r(t),i.d(t,{default:()=>me});var r,s=i(5482),l=i(11254),o=i(4576),n=i(7762),a=i(49186),c=i(4718),u=i(25728),p=i(93637),d=i(74887),m=i(36708),h=i(84952),y=i(91429),f=i(5443),g=i(4146),w=i(47314),v=i(63074),M=i(16131),x=i(8303),C=i(54310),I=i(25036),S=i(33446),L=i(87045),T=i(65509),A=i(83703),b=i(25482);let P=r=class extends b.o{constructor(e){super(e),this.fullExtent=null,this.id=null,this.tileInfo=null}clone(){const e=new r;return this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent?.clone()??null),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("tileInfo")&&(e.tileInfo=this.tileInfo?.clone()??null),e}};(0,s.Cg)([(0,y.MZ)({type:f.A,json:{read:{source:"fullExtent"}}})],P.prototype,"fullExtent",void 0),(0,s.Cg)([(0,y.MZ)({type:String,json:{read:{source:"id"}}})],P.prototype,"id",void 0),(0,s.Cg)([(0,y.MZ)({type:L.A,json:{read:{source:"tileInfo"}}})],P.prototype,"tileInfo",void 0),P=r=(0,s.Cg)([(0,y.$K)("esri.layers.support.TileMatrixSet")],P);const E=P;var O;let R=O=class extends b.o{constructor(e){super(e),this.id=null,this.title=null,this.description=null,this.legendUrl=null}clone(){const e=new O;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("isDefault")&&(e.isDefault=this.isDefault),this.hasOwnProperty("keywords")&&(e.keywords=this.keywords&&this.keywords.slice()),this.hasOwnProperty("legendUrl")&&(e.legendUrl=this.legendUrl),this.hasOwnProperty("title")&&(e.title=this.title),e}};(0,s.Cg)([(0,y.MZ)({json:{read:{source:"id"}}})],R.prototype,"id",void 0),(0,s.Cg)([(0,y.MZ)({json:{read:{source:"title"}}})],R.prototype,"title",void 0),(0,s.Cg)([(0,y.MZ)({json:{read:{source:"abstract"}}})],R.prototype,"description",void 0),(0,s.Cg)([(0,y.MZ)({json:{read:{source:"legendUrl"}}})],R.prototype,"legendUrl",void 0),(0,s.Cg)([(0,y.MZ)({json:{read:{source:"isDefault"}}})],R.prototype,"isDefault",void 0),(0,s.Cg)([(0,y.MZ)({json:{read:{source:"keywords"}}})],R.prototype,"keywords",void 0),R=O=(0,s.Cg)([(0,y.$K)("esri.layers.support.WMTSStyle")],R);const F=R;var Z,V=i(36005);let U=Z=class extends b.o{constructor(e){super(e),this.description=null,this.fullExtent=null,this.fullExtents=null,this.id=null,this.imageFormats=null,this.layer=null,this.parent=null,this.styles=null,this.title=null,this.tileMatrixSetId=null,this.tileMatrixSets=null}readFullExtent(e,t){return(e=t.fullExtent)?f.A.fromJSON(e):null}readFullExtents(e,t){return t.fullExtents?.length?t.fullExtents.map(e=>f.A.fromJSON(e)):t.tileMatrixSets?.map(e=>f.A.fromJSON(e.fullExtent)).filter(e=>e)??[]}get imageFormat(){let e=this._get("imageFormat");return e||(e=this.imageFormats?.length?this.imageFormats[0]:""),e}set imageFormat(e){const t=this.imageFormats;e&&(e.includes("image/")||t&&!t.includes(e))&&(e.includes("image/")||(e="image/"+e),t&&!t.includes(e))?console.error("The layer doesn't support the format of "+e):this._set("imageFormat",e)}get styleId(){let e=this._get("styleId");return e||(e=this.styles?.at(0)?.id??""),e}set styleId(e){this._set("styleId",e)}get tileMatrixSet(){return this.tileMatrixSets?.find(({id:e})=>e===this.tileMatrixSetId)??null}clone(){const e=new Z;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("imageFormats")&&(e.imageFormats=this.imageFormats?.slice()??null),this.hasOwnProperty("imageFormat")&&(e.imageFormat=this.imageFormat),this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent?.clone()),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("layer")&&(e.layer=this.layer),this.hasOwnProperty("styleId")&&(e.styleId=this.styleId),this.hasOwnProperty("styles")&&(e.styles=this.styles?.clone()),this.hasOwnProperty("tileMatrixSetId")&&(e.tileMatrixSetId=this.tileMatrixSetId),this.hasOwnProperty("tileMatrixSets")&&(e.tileMatrixSets=this.tileMatrixSets?.clone()),this.hasOwnProperty("title")&&(e.title=this.title),e}};(0,s.Cg)([(0,y.MZ)()],U.prototype,"description",void 0),(0,s.Cg)([(0,y.MZ)({type:f.A})],U.prototype,"fullExtent",void 0),(0,s.Cg)([(0,V.w)("fullExtent",["fullExtent"])],U.prototype,"readFullExtent",null),(0,s.Cg)([(0,y.MZ)({readOnly:!0})],U.prototype,"fullExtents",void 0),(0,s.Cg)([(0,V.w)("fullExtents",["fullExtents","tileMatrixSets"])],U.prototype,"readFullExtents",null),(0,s.Cg)([(0,y.MZ)()],U.prototype,"id",void 0),(0,s.Cg)([(0,y.MZ)()],U.prototype,"imageFormat",null),(0,s.Cg)([(0,y.MZ)({json:{read:{source:"formats"}}})],U.prototype,"imageFormats",void 0),(0,s.Cg)([(0,y.MZ)()],U.prototype,"layer",void 0),(0,s.Cg)([(0,y.MZ)()],U.prototype,"parent",void 0),(0,s.Cg)([(0,y.MZ)()],U.prototype,"styleId",null),(0,s.Cg)([(0,y.MZ)({type:n.A.ofType(F),json:{read:{source:"styles"}}})],U.prototype,"styles",void 0),(0,s.Cg)([(0,y.MZ)({json:{write:{ignoreOrigin:!0}}})],U.prototype,"title",void 0),(0,s.Cg)([(0,y.MZ)()],U.prototype,"tileMatrixSetId",void 0),(0,s.Cg)([(0,y.MZ)({readOnly:!0})],U.prototype,"tileMatrixSet",null),(0,s.Cg)([(0,y.MZ)({type:n.A.ofType(E),json:{read:{source:"tileMatrixSets"}}})],U.prototype,"tileMatrixSets",void 0),U=Z=(0,s.Cg)([(0,y.$K)("esri.layers.support.WMTSSublayer")],U);var j=i(73941),_=i(86738),N=i(22530),k=i(38458),D=i(13043),W=i(91806);const K=90.71428571428571;function B(e){const t=e.replaceAll(/ows:/gi,"");return(new DOMParser).parseFromString(t,"text/xml")}function $(e){if(!J("Contents",e.documentElement))throw new a.A("wmtslayer:wmts-capabilities-xml-is-not-valid","the wmts get capabilities response is not compliant")}function H(e){return e.nodeType===Node.ELEMENT_NODE}function J(e,t){for(let i=0;i<t.childNodes.length;i++){const r=t.childNodes[i];if(H(r)&&r.nodeName===e)return r}return null}function q(e,t){const i=[];for(let r=0;r<t.childNodes.length;r++){const s=t.childNodes[r];H(s)&&s.nodeName===e&&i.push(s)}return i}function G(e,t){const i=[];for(let r=0;r<t.childNodes.length;r++){const s=t.childNodes[r];H(s)&&s.nodeName===e&&i.push(s)}return i.map(e=>e.textContent).filter(o.Ru)}function z(e,t){return e.split(">").forEach(e=>{t&&(t=J(e,t))}),t&&t.textContent}function Q(e,t,i,r){let s;return Array.prototype.slice.call(r.childNodes).some(r=>{if(r.nodeName.includes(e)){const e=J(t,r),l=e?.textContent;if(l===i||i.split(":")&&i.split(":")[1]===l)return s=r,!0}return!1}),s}function X(e,t,i,r,s){const l=z("Abstract",t),o=G("Format",t);return{id:e,fullExtent:ee(t),fullExtents:te(t),description:l,formats:o,styles:ie(t,r),title:z("Title",t),tileMatrixSets:re(s,t,i)}}function Y(e,t){const i=[],r=e.layerMap?.get(t);if(!r)return null;const s=q("ResourceURL",r),l=q("Dimension",r);let o,n,a,c;return l.length&&(o=z("Identifier",l[0]),n=G("Default",l[0])||G("Value",l[0])),l.length>1&&(a=z("Identifier",l[1]),c=G("Default",l[1])||G("Value",l[1])),e.dimensionMap.set(t,{dimensions:n,dimensions2:c}),s.forEach(e=>{let t=e.getAttribute("template");if("tile"===e.getAttribute("resourceType")){if(o&&n.length)if(t.includes("{"+o+"}"))t=t.replace("{"+o+"}","{dimensionValue}");else{const e=t.toLowerCase().indexOf("{"+o.toLowerCase()+"}");e>-1&&(t=t.slice(0,e)+"{dimensionValue}"+t.slice(e+o.length+2))}if(a&&c.length)if(t.includes("{"+a+"}"))t=t.replace("{"+a+"}","{dimensionValue2}");else{const e=t.toLowerCase().indexOf("{"+a.toLowerCase()+"}");e>-1&&(t=t.slice(0,e)+"{dimensionValue2}"+t.slice(e+a.length+2))}i.push({template:t,format:e.getAttribute("format"),resourceType:"tile"})}}),i}function ee(e){const t=J("WGS84BoundingBox",e),i=t?z("LowerCorner",t).split(" "):["-180","-90"],r=t?z("UpperCorner",t).split(" "):["180","90"];return{xmin:parseFloat(i[0]),ymin:parseFloat(i[1]),xmax:parseFloat(r[0]),ymax:parseFloat(r[1]),spatialReference:{wkid:4326}}}function te(e){const t=[];return(0,D.p)(e,{BoundingBox:e=>{if(!e.getAttribute("crs"))return;const i=e.getAttribute("crs").toLowerCase(),r=se(i),s=i.includes("epsg")&&(0,k.m)(r.wkid);let l,o,n,a;(0,D.p)(e,{LowerCorner:e=>{[l,o]=e.textContent.split(" ").map(e=>Number.parseFloat(e)),s&&([l,o]=[o,l])},UpperCorner:e=>{[n,a]=e.textContent.split(" ").map(e=>Number.parseFloat(e)),s&&([n,a]=[a,n])}}),t.push({xmin:l,ymin:o,xmax:n,ymax:a,spatialReference:r})}}),t}function ie(e,t){return q("Style",e).map(e=>{const i=J("LegendURL",e),r=J("Keywords",e),s=r?G("Keyword",r):[];let l=i?.getAttribute("xlink:href");return t&&(l=l?.replace(/^http:/i,"https:")),{abstract:z("Abstract",e),id:z("Identifier",e),isDefault:"true"===e.getAttribute("isDefault"),keywords:s,legendUrl:l,title:z("Title",e)}})}function re(e,t,i){return q("TileMatrixSetLink",t).map(t=>function(e,t,i){const r=J("TileMatrixSet",t).textContent,s=G("TileMatrix",t),l=i.find(e=>{const t=J("Identifier",e),i=t?.textContent;return!!(i===r||r.split(":")&&r.split(":")[1]===i)}),o=J("TileMatrixSetLimits",t),n=o&&q("TileMatrixLimits",o),a=new Map;if(n?.length)for(const e of n){const t=J("TileMatrix",e).textContent,i=+J("MinTileRow",e).textContent,r=+J("MaxTileRow",e).textContent,s=+J("MinTileCol",e).textContent,l=+J("MaxTileCol",e).textContent;a.set(t,{minCol:s,maxCol:l,minRow:i,maxRow:r})}const c=z("SupportedCRS",l).toLowerCase(),u=function(e,t){return le(J("TileMatrix",e),t)}(l,c),p=u.spatialReference,d=J("TileMatrix",l),m=[parseInt(z("TileWidth",d),10),parseInt(z("TileHeight",d),10)],h=[];s.length?s.forEach((e,t)=>{const i=Q("TileMatrix","Identifier",e,l);h.push(oe(i,c,t,r,a))}):q("TileMatrix",l).forEach((e,t)=>{h.push(oe(e,c,t,r,a))});const y=function(e,t,i,r,s){const l=J("BoundingBox",t);let o,n,a,c,u,p;if(l&&(o=z("LowerCorner",l).split(" "),n=z("UpperCorner",l).split(" ")),o&&o.length>1&&n&&n.length>1)a=parseFloat(o[0]),u=parseFloat(o[1]),c=parseFloat(n[0]),p=parseFloat(n[1]);else{const e=J("TileMatrix",t),l=parseInt(z("MatrixWidth",e),10),o=parseInt(z("MatrixHeight",e),10);a=i.x,p=i.y,c=a+l*r[0]*s.resolution,u=p-o*r[1]*s.resolution}return function(e,t,i){return"1.0.0"===e&&(0,k.m)(t.wkid)&&!(i.spatialReference.isGeographic&&i.x<-90&&i.y>=-90)}(e,i.spatialReference,i)?new f.A(u,a,p,c,i.spatialReference):new f.A(a,u,c,p,i.spatialReference)}(e,l,u,m,h[0]).toJSON(),g=new L.A({dpi:96,spatialReference:p,size:m,origin:u,lods:h}).toJSON();return{id:r,fullExtent:y,tileInfo:g}}(e,t,i))}function se(e){e=e.toLowerCase();let t=parseInt(e.split(":").pop(),10);900913!==t&&3857!==t||(t=102100);const i=function(e){return e.includes("crs84")||e.includes("crs:84")?4326:e.includes("crs83")||e.includes("crs:83")?4269:e.includes("crs27")||e.includes("crs:27")?4267:null}(e);return null!=i&&(t=i),{wkid:t}}function le(e,t){const i=se(t),[r,s]=z("TopLeftCorner",e).split(" ").map(e=>parseFloat(e)),l=t.includes("epsg")&&(0,k.m)(i.wkid);return new _.A(l?{x:s,y:r,spatialReference:i}:{x:r,y:s,spatialReference:i})}function oe(e,t,i,r,s){const l=se(t),o=z("Identifier",e);let n=parseFloat(z("ScaleDenominator",e));const a=ne(l.wkid,n,r);n*=96/K;const c=+z("MatrixWidth",e),u=+z("MatrixHeight",e),{maxCol:p=c-1,maxRow:d=u-1,minCol:m=0,minRow:h=0}=s.get(o)??{},{x:y,y:f}=le(e,t);return new W.A({cols:[m,p],level:i,levelValue:o,origin:[y,f],scale:n,resolution:a,rows:[h,d]})}function ne(e,t,i){let r;return r=N.A.hasOwnProperty(""+e)?N.A.values[N.A[e]]:"default028mm"===i?6370997*Math.PI/180:(0,j.y7)(e).metersPerDegree,7*t/25e3/r}var ae,ce=i(43937);const ue={"image/png":".png","image/png8":".png","image/png24":".png","image/png32":".png","image/jpg":".jpg","image/jpeg":".jpeg","image/gif":".gif","image/bmp":".bmp","image/tiff":".tif","image/jpgpng":"","image/jpegpng":"","image/unknown":""},pe=new Set(["version","service","request","layer","style","format","tilematrixset","tilematrix","tilerow","tilecol"]);let de=ae=class extends((0,v.dM)((0,C.J)((0,I.j)((0,M.q)((0,x.A)((0,u.M)(g.A))))))){constructor(...e){super(...e),this.activeLayer=null,this.copyright="",this.customParameters=null,this.customLayerParameters=null,this.fullExtent=null,this.operationalLayerType="WebTiledLayer",this.resourceInfo=null,this.serviceMode="RESTful",this.sublayers=null,this.type="wmts",this.version="1.0.0",this.addHandles([(0,m.wB)(()=>this.activeLayer,(e,t)=>{t&&!this.sublayers?.includes(t)&&(t.layer=null,t.parent=null),e&&(e.layer=this,e.parent=this)},m.OH),(0,m.on)(()=>this.sublayers,"after-add",({item:e})=>{e.layer=this,e.parent=this},m.OH),(0,m.on)(()=>this.sublayers,"after-remove",({item:e})=>{e.layer=null,e.parent=null},m.OH),(0,m.wB)(()=>this.sublayers,(e,t)=>{if(t)for(const e of t)e.layer=null,e.parent=null;if(e)for(const t of e)t.layer=this,t.parent=this},m.OH)])}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMTS"]},e).catch(d.QP).then(()=>this._fetchService(e)).catch(e=>{throw(0,d.QP)(e),new a.A("wmtslayer:unsupported-service-data","Invalid response from the WMTS service.",{error:e})})),Promise.resolve(this)}readActiveLayerFromService(e,t,i){this.activeLayer||(this.activeLayer=new U);let r=t.layers.find(e=>e.id===this.activeLayer.id);return r||(r=t.layers[0]),this.activeLayer.read(r,i),this.activeLayer}readActiveLayerFromItemOrWebDoc(e,t){const{templateUrl:i,wmtsInfo:r}=t,s=i?this._getLowerCasedUrlParams(i):null,l=r?.layerIdentifier;let o=null;const n=r?.tileMatrixSet;n&&(Array.isArray(n)?n.length&&(o=n[0]):o=n);const a=s?.format,c=s?.style;return new U({id:l,imageFormat:a,styleId:c,tileMatrixSetId:o})}writeActiveLayer(e,t,i,r){const s=this.activeLayer;t.templateUrl=this.getUrlTemplate(s.id,s.tileMatrixSetId,s.imageFormat,s.styleId);const l=(0,p.wc)("tileMatrixSet.tileInfo",s);t.tileInfo=l?l.toJSON(r):null,t.wmtsInfo={...t.wmtsInfo,layerIdentifier:s.id,tileMatrixSet:s.tileMatrixSetId}}readCustomParameters(e,t){const i=t.wmtsInfo;return i?this._mergeParams(i.customParameters,i.url):null}get fullExtents(){return this.activeLayer.fullExtents}readServiceMode(e,t){return t.templateUrl.includes("?")?"KVP":"RESTful"}readSublayersFromService(e,t,i){return function(e,t){return e.map(e=>{const i=new U;return i.read(e,t),i})}(t.layers,i)}get supportedSpatialReferences(){return this.activeLayer.tileMatrixSets?.map(e=>e.tileInfo?.spatialReference).toArray().filter(o.Ru)??[]}get tilemapCache(){const e=this.activeLayer?.tileMatrixSet?.tileInfo;return e?new T.A(e):void 0}get title(){return this.activeLayer?.title??"Layer"}set title(e){this._overrideIfSome("title",e)}get url(){return this._get("url")}set url(e){e&&e.endsWith("/")?this._set("url",e.slice(0,-1)):this._set("url",e)}createWebTileLayer(e){const t=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId),i=this._getTileMatrixSetById(e.tileMatrixSetId),r=i?.tileInfo,s=e.fullExtent,l=new A.x({layerIdentifier:e.id,tileMatrixSet:e.tileMatrixSetId,url:this.url});return this.customLayerParameters&&(l.customLayerParameters=this.customLayerParameters),this.customParameters&&(l.customParameters=this.customParameters),new w.default({fullExtent:s,urlTemplate:t,tileInfo:r,wmtsInfo:l})}async fetchTile(e,t,i,r={}){const{signal:s}=r,o=this.getTileUrl(e,t,i),{data:n}=await(0,l.A)(o,{responseType:"image",signal:s});return n}async fetchImageBitmapTile(e,t,i,r={}){const{signal:s}=r;if(this.fetchTile!==ae.prototype.fetchTile){const l=await this.fetchTile(e,t,i,r);return(0,S.C)(l,e,t,i,s)}const o=this.getTileUrl(e,t,i),{data:n}=await(0,l.A)(o,{responseType:"blob",signal:s});return(0,S.C)(n,e,t,i,s)}findSublayerById(e){return this.sublayers?.find(t=>t.id===e)}getTileUrl(e,t,i){const r=this._getTileMatrixSetById(this.activeLayer.tileMatrixSetId),s=r?.tileInfo?.lods[e],l=s?s.levelValue||`${s.level}`:`${e}`;let o=this.resourceInfo?"":function(e,t,i,r,s,l,o,n){const a=function(e,t,i){const r=Y(e,t),s=r?.filter(e=>e.format===i);return(s?.length?s:r)??[]}(e,t,r);if(!(a?.length>0))return"";const{dimensionMap:c}=e,u=c.get(t).dimensions?.[0],p=c.get(t).dimensions2?.[0];return a[o%a.length].template.replaceAll(/\{Style\}/gi,s??"").replaceAll(/\{TileMatrixSet\}/gi,i??"").replaceAll(/\{TileMatrix\}/gi,l).replaceAll(/\{TileRow\}/gi,""+o).replaceAll(/\{TileCol\}/gi,""+n).replaceAll(/\{dimensionValue\}/gi,u).replaceAll(/\{dimensionValue2\}/gi,p)}({dimensionMap:this.dimensionMap,layerMap:this.layerMap},this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId,l,t,i);return o||(o=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId).replaceAll(/\{level\}/gi,l).replaceAll(/\{row\}/gi,`${t}`).replaceAll(/\{col\}/gi,`${i}`)),o=this._appendCustomLayerParameters(o),o}getUrlTemplate(e,t,i,r){if(!this.resourceInfo){const i=function(e,t,i,r){const{dimensionMap:s}=e,l=Y(e,t);let o="";if(l&&l.length>0){const e=s.get(t).dimensions?.[0],n=s.get(t).dimensions2?.[0];o=l[0].template,o.endsWith(".xxx")&&(o=o.slice(0,-4)),o=o.replaceAll(/\{Style\}/gi,r),o=o.replaceAll(/\{TileMatrixSet\}/gi,i),o=o.replaceAll(/\{TileMatrix\}/gi,"{level}"),o=o.replaceAll(/\{TileRow\}/gi,"{row}"),o=o.replaceAll(/\{TileCol\}/gi,"{col}"),o=o.replaceAll(/\{dimensionValue\}/gi,e),o=o.replaceAll(/\{dimensionValue2\}/gi,n)}return o}({dimensionMap:this.dimensionMap,layerMap:this.layerMap},e,t,r);if(i)return i}if("KVP"===this.serviceMode)return this.url+"?SERVICE=WMTS&VERSION="+this.version+"&REQUEST=GetTile&LAYER="+e+"&STYLE="+r+"&FORMAT="+i+"&TILEMATRIXSET="+t+"&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}";if("RESTful"===this.serviceMode){let s="";return ue[i.toLowerCase()]&&(s=ue[i.toLowerCase()]),this.url+e+"/"+r+"/"+t+"/{level}/{row}/{col}"+s}return""}async _fetchService(e){if(this.resourceInfo)return"KVP"!==this.resourceInfo.serviceMode||this.url.includes("?")||(this.url+="?"),function(e){for(const t of e.layers)for(const e of t.tileMatrixSets??[]){const{tileInfo:t}=e;if(t&&96!==t.dpi){for(const i of t.lods??[])i.scale=96*i.scale/t.dpi,i.resolution=ne(t.spatialReference?.wkid,i.scale*K/96,e.id);t.dpi=96}}}(this.resourceInfo),void this.read(this.resourceInfo,{origin:"service"});let t=null;try{const{data:i}=await this._getCapabilities(this.serviceMode,e);t=B(i),$(t)}catch{const i="KVP"===this.serviceMode?"RESTful":"KVP";try{const{data:r}=await this._getCapabilities(i,e);t=B(r),$(t),this.serviceMode=i}catch(e){throw new a.A("wmtslayer:unsupported-service-data","Services does not support RESTful or KVP service modes.",{error:e})}}const{serviceMode:i,url:r}=this,s=function(e,t){const i=e.documentElement,r=new Map,s=new Map,l=J("Contents",i);if(!l)throw new a.A("wmtslayer:wmts-capabilities-xml-is-not-valid","Can't retrieve xml capabilities element");const o=J("OperationsMetadata",i),n=o?.querySelector("[name='GetTile']"),c=n?.getElementsByTagName("Get"),u=c&&Array.prototype.slice.call(c),p=t.url?.indexOf("https"),d=void 0!==p&&p>-1;let m,h,y=t.serviceMode,f=t?.url;if(u?.length&&u.some(e=>{const t=J("Constraint",e);return!t||Q("AllowedValues","Value",y,t)?(f=e.attributes[0].nodeValue,!0):(!t||Q("AllowedValues","Value","RESTful",t)||Q("AllowedValues","Value","REST",t)?h=e.attributes[0].nodeValue:t&&!Q("AllowedValues","Value","KVP",t)||(m=e.attributes[0].nodeValue),!1)}),!f)if(h)f=h,y="RESTful";else if(m)f=m,y="KVP";else{const e=J("ServiceMetadataURL",i);f=e?.getAttribute("xlink:href")}const g=f.indexOf("1.0.0/");-1===g&&"RESTful"===y?f+="/":g>-1&&(f=f.slice(0,g)),"KVP"===y&&(f+=g>-1?"":"?"),d&&(f=f.replace(/^http:/i,"https:"));const w=z("ServiceIdentification>ServiceTypeVersion",i),v=z("ServiceIdentification>AccessConstraints",i),M=v&&/^none$/i.test(v)?null:v,x=q("Layer",l),C=q("TileMatrixSet",l),I=x.map(e=>{const t=z("Identifier",e);return r.set(t,e),X(t,e,C,d,w)});return{copyright:M,dimensionMap:s,layerMap:r,layers:I,serviceMode:y,tileUrl:f}}(t,{serviceMode:i,url:r});this.read(s,{origin:"service"})}async _getCapabilities(e,t){const i=this._getCapabilitiesUrl(e);return await(0,l.A)(i,{...t,responseType:"text"})}_getTileMatrixSetById(e){const t=this.findSublayerById(this.activeLayer.id);return t?.tileMatrixSets?.find(({id:t})=>t===e)}_appendCustomParameters(e){return this._appendParameters(e,this.customParameters)}_appendCustomLayerParameters(e){return this._appendParameters(e,{...(0,c.o8)(this.customParameters),...this.customLayerParameters})}_appendParameters(e,t){const i=(0,h.An)(e),r={...i.query,...t},s=(0,h.x0)(r);return""===s?i.path:`${i.path}?${s}`}_getCapabilitiesUrl(e){this.url=(0,h.An)(this.url).path;let t=this.url;switch(e){case"KVP":t+=`?request=GetCapabilities&service=WMTS&version=${this.version}`;break;case"RESTful":{const e=`/${this.version}/WMTSCapabilities.xml`,i=new RegExp(e,"i");t=t.replace(i,""),t+=e;break}}return this._appendCustomParameters(t)}_getLowerCasedUrlParams(e){if(!e)return null;const t=(0,h.An)(e).query;if(!t)return null;const i={};return Object.keys(t).forEach(e=>{i[e.toLowerCase()]=t[e]}),i}_mergeParams(e,t){const i=this._getLowerCasedUrlParams(t);if(i){const t=Object.keys(i);t.length&&(e=e?(0,c.o8)(e):{},t.forEach(t=>{e.hasOwnProperty(t)||pe.has(t)||(e[t]=i[t])}))}return e}};(0,s.Cg)([(0,y.MZ)()],de.prototype,"dimensionMap",void 0),(0,s.Cg)([(0,y.MZ)()],de.prototype,"layerMap",void 0),(0,s.Cg)([(0,y.MZ)({type:U,json:{origins:{"web-document":{write:{ignoreOrigin:!0}}}}})],de.prototype,"activeLayer",void 0),(0,s.Cg)([(0,V.w)("service","activeLayer",["layers"])],de.prototype,"readActiveLayerFromService",null),(0,s.Cg)([(0,V.w)(["web-document","portal-item"],"activeLayer",["wmtsInfo"])],de.prototype,"readActiveLayerFromItemOrWebDoc",null),(0,s.Cg)([(0,ce.K)(["web-document","portal-item"],"activeLayer",{templateUrl:{type:String},tileInfo:{type:L.A},"wmtsInfo.layerIdentifier":{type:String},"wmtsInfo.tileMatrixSet":{type:String}})],de.prototype,"writeActiveLayer",null),(0,s.Cg)([(0,y.MZ)({type:String,value:"",json:{write:!0}})],de.prototype,"copyright",void 0),(0,s.Cg)([(0,y.MZ)({type:["show","hide"]})],de.prototype,"listMode",void 0),(0,s.Cg)([(0,y.MZ)({json:{read:!0,write:!0}})],de.prototype,"blendMode",void 0),(0,s.Cg)([(0,y.MZ)({json:{origins:{"web-document":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}},"portal-item":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}}}}})],de.prototype,"customParameters",void 0),(0,s.Cg)([(0,V.w)(["portal-item","web-document"],"customParameters")],de.prototype,"readCustomParameters",null),(0,s.Cg)([(0,y.MZ)({json:{origins:{"web-document":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}},"portal-item":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}}}}})],de.prototype,"customLayerParameters",void 0),(0,s.Cg)([(0,y.MZ)({type:f.A,json:{write:{ignoreOrigin:!0},origins:{"web-document":{read:{source:"fullExtent"}},"portal-item":{read:{source:"fullExtent"}}}}})],de.prototype,"fullExtent",void 0),(0,s.Cg)([(0,y.MZ)({readOnly:!0})],de.prototype,"fullExtents",null),(0,s.Cg)([(0,y.MZ)({type:["WebTiledLayer"]})],de.prototype,"operationalLayerType",void 0),(0,s.Cg)([(0,y.MZ)()],de.prototype,"resourceInfo",void 0),(0,s.Cg)([(0,y.MZ)()],de.prototype,"serviceMode",void 0),(0,s.Cg)([(0,V.w)(["portal-item","web-document"],"serviceMode",["templateUrl"])],de.prototype,"readServiceMode",null),(0,s.Cg)([(0,y.MZ)({type:n.A.ofType(U)})],de.prototype,"sublayers",void 0),(0,s.Cg)([(0,V.w)("service","sublayers",["layers"])],de.prototype,"readSublayersFromService",null),(0,s.Cg)([(0,y.MZ)({readOnly:!0})],de.prototype,"supportedSpatialReferences",null),(0,s.Cg)([(0,y.MZ)({readOnly:!0})],de.prototype,"tilemapCache",null),(0,s.Cg)([(0,y.MZ)({json:{read:{source:"title"}}})],de.prototype,"title",null),(0,s.Cg)([(0,y.MZ)({json:{read:!1},readOnly:!0,value:"wmts"})],de.prototype,"type",void 0),(0,s.Cg)([(0,y.MZ)({json:{origins:{service:{read:{source:"tileUrl"}},"web-document":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}},"portal-item":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}}}}})],de.prototype,"url",null),(0,s.Cg)([(0,y.MZ)()],de.prototype,"version",void 0),de=ae=(0,s.Cg)([(0,y.$K)("esri.layers.WMTSLayer")],de);const me=de},38458(e,t,i){i.d(t,{m:()=>s});const r=[[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&&r.some(([t,i])=>e>=t&&e<=i)}},13043(e,t,i){function r(e,t){if(e&&t)for(const i of e.children)if(i.localName in t){const e=t[i.localName];if("function"==typeof e){const t=e(i);t&&r(i,t)}else r(i,e)}}function*s(e,t){for(const i of e.children)if(i.localName in t){const e=t[i.localName];"function"==typeof e?yield e(i):yield*s(i,e)}}i.d(t,{i:()=>s,p:()=>r})},65509(e,t,i){i.d(t,{A:()=>l});var r=i(49186),s=i(74887);class l{constructor(e,t=0,i=e.lods[e.lods.length-1].level){this.tileInfo=e,this.minLOD=t,this.maxLOD=i,e.lodAt(t)||(this.minLOD=e.lods[0].level),e.lodAt(i)||(this.maxLOD=e.lods[e.lods.length-1].level)}get effectiveMinLOD(){return this.minLOD??this.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.tileInfo.lods[this.tileInfo.lods.length-1].level}getAvailability(e,t,i){const r=this.tileInfo?.lodAt(e);return!r||e<this.minLOD||e>this.maxLOD?"unavailable":r.cols&&r.rows?i>=r.cols[0]&&i<=r.cols[1]&&t>=r.rows[0]&&t<=r.rows[1]?"unknown":"unavailable":"unknown"}async fetchAvailability(e,t,i,l){await(0,s.NO)(l);const o=this.getAvailability(e,t,i);if("unavailable"===o)throw new r.A("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:i});return o}async fetchAvailabilityUpsample(e,t,i,r,l){await(0,s.NO)(l),r.level=e,r.row=t,r.col=i;const o=this.tileInfo;return o.updateTileInfo(r),this.fetchAvailability(e,t,i,l).catch(e=>{if((0,s.zf)(e))throw e;if(o.upsampleTile(r))return this.fetchAvailabilityUpsample(r.level,r.row,r.col,r,l);throw e})}}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5217],{25217(e,t,i){i.r(t),i.d(t,{default:()=>h});var a=i(49186),s=i(74887),c=i(40036),l=i(16930),n=i(19211),o=i(35063),r=i(66655);class h{constructor(e,t,i,c,h,w,u,d,f){this.level=e,this.row=t,this.column=i,this.horizontalFieldOfView=c,this.verticalFieldOfView=h,this.yaw=w,this.pitch=u,this.distance=d,this.getPixelBlock=f,this._cache=null,this.loadMesh=async e=>{const{level:t,row:i,column:c,horizontalFieldOfView:h,verticalFieldOfView:w,yaw:u,pitch:d,distance:f}=this,{Mesh:m,MeshComponent:p,MeshVertexAttributes:v,panoramicMeshManager:g}=await(0,r.Zg)(),{faces:x,...M}=await g.getFacesWithVertexAttributes({distance:f,yaw:u,horizontalFieldOfView:h,pitch:d,verticalFieldOfView:w});(0,s.Te)(e);const V=await this.getPixelBlock(t,i,c,e);if((0,s.Te)(e),!V)throw new a.A("panoramic-viewer:missing-tile-data",`Tile data for level ${t}, row ${i}, column ${c} is missing`,{level:t,row:i,column:c});const b=await g.convertPixelBlockToImageData(V);(0,s.Te)(e);const k=new m({vertexAttributes:new v(M),components:[new p({faces:x,trustSourceNormals:!0,material:new n.default({colorTexture:new o.default({data:b})})})],spatialReference:l.A.WebMercator});return await k.load(e),this._cache=k,this._cache},this.loadMeshAtDistance=async(e,t)=>{const i=this.distance;return this.distance=e,Math.abs(i-e)>1e-6&&this._cache?this._cache:await this.loadMesh(t)}}get loaded(){return null!==this._cache}get key(){return`${this.level}/${this.row}/${this.column}`}clone(){const{level:e,row:t,column:i,horizontalFieldOfView:a,verticalFieldOfView:s,yaw:l,pitch:n,distance:o,getPixelBlock:r}=this,w=new h(e,t,i,a,s,l,n,o,r);if(this._cache){const{vertexAttributes:e,components:t,spatialReference:i}=this._cache,a=t?.map(({material:e,faces:t,trustSourceNormals:i})=>({material:e,faces:t?.slice(),trustSourceNormals:i}));w._cache=new c.default({components:a,vertexAttributes:e.clone(),spatialReference:i})}return w}}}}]);
|