@arcgis/core 4.33.0-next.20250501 → 4.33.0-next.20250503
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/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{0219c3f9408d3fa3c9a0.js → 03ee9d0407c230b885ed.js} +1 -1
- package/assets/esri/core/workers/chunks/{de16b771d2c8d816c738.js → 05c80002c37002ac99e8.js} +1 -1
- package/assets/esri/core/workers/chunks/{5d40c4783f58af1ae0dc.js → 0e8181e7fc1386d08ffc.js} +1 -1
- package/assets/esri/core/workers/chunks/{96e5d192c8d23c1e324f.js → 13e68c43acc8916520db.js} +1 -1
- package/assets/esri/core/workers/chunks/{e6a5911ea21bef32834b.js → 1bc22af4cc4effcbcf2b.js} +1 -1
- package/assets/esri/core/workers/chunks/{84f972d7851d982701a0.js → 1ca7e0d519ecbfe6976f.js} +1 -1
- package/assets/esri/core/workers/chunks/{9b2ab27159500315fbc1.js → 26850ec0917ee355ddb7.js} +1 -1
- package/assets/esri/core/workers/chunks/{1bd4fe77ba6fb25322e7.js → 29e2b105f55adafc3a6d.js} +1 -1
- package/assets/esri/core/workers/chunks/{5d63dfa5a60c88e03b28.js → 2c77a543a174e5bc736a.js} +1 -1
- package/assets/esri/core/workers/chunks/{d0ddf4f1c6a351b447c7.js → 30d7d2c7d6e9e5e2ecb9.js} +1 -1
- package/assets/esri/core/workers/chunks/3fb25912b274f264c84e.js +1 -0
- package/assets/esri/core/workers/chunks/{febae745a29a17ca130a.js → 4480e4b61affb3b2e9d6.js} +1 -1
- package/assets/esri/core/workers/chunks/{4d4a271351fd288277d2.js → 49085a0b3a74e158f32f.js} +1 -1
- package/assets/esri/core/workers/chunks/{392e64a573f67817db02.js → 4cb199b547e5b97e65fb.js} +1 -1
- package/assets/esri/core/workers/chunks/4df36ee2406861c7afa8.js +1 -0
- package/assets/esri/core/workers/chunks/{9652cfd4668b95036c87.js → 532088a72c3ddc50f3be.js} +1 -1
- package/assets/esri/core/workers/chunks/{ba917175ca2a6681501e.js → 563594357f3648652a5c.js} +1 -1
- package/assets/esri/core/workers/chunks/{abfc5f9ac16c3e885c5f.js → 56db71ea7eb8a5652d98.js} +1 -1
- package/assets/esri/core/workers/chunks/{e56647e61296643c5f84.js → 5719471414810b6a9aec.js} +1 -1
- package/assets/esri/core/workers/chunks/{235efd948ae470a6f238.js → 60b1365d25581ccf0485.js} +1 -1
- package/assets/esri/core/workers/chunks/{3795793643f4db64af0e.js → 63c25455b9cf1b3df76a.js} +1 -1
- package/assets/esri/core/workers/chunks/{909be86782af3deb448e.js → 654fe135d41af81daa13.js} +1 -1
- package/assets/esri/core/workers/chunks/{cd9343c78a7c3acdbbcd.js → 681b2662f6ce936afd7e.js} +1 -1
- package/assets/esri/core/workers/chunks/{65f2b22d8fc12e6d4a87.js → 7000d9158da929a16071.js} +1 -1
- package/assets/esri/core/workers/chunks/{7551011117c3d36ff3db.js → 743cdbff5c4616ddc2b4.js} +1 -1
- package/assets/esri/core/workers/chunks/{968956284f44187f0622.js → 8540fb31bd0b29ff1906.js} +1 -1
- package/assets/esri/core/workers/chunks/8c5cea49e48f8858f115.js +1 -0
- package/assets/esri/core/workers/chunks/{237a965bd41ba8903e03.js → 921c040d0497031fd8ff.js} +1 -1
- package/assets/esri/core/workers/chunks/{96d2a0777f5c418055fb.js → 92b48e3365d1cc933113.js} +1 -1
- package/assets/esri/core/workers/chunks/{5d485c07848164099859.js → 95a4da3150ad8e8e36d8.js} +1 -1
- package/assets/esri/core/workers/chunks/{46fb6ba8900286d18b6f.js → 9d564f79b82d427fc1da.js} +1 -1
- package/assets/esri/core/workers/chunks/{00612d6e05b1c8647668.js → 9fff43ffcd5602ccc50f.js} +1 -1
- package/assets/esri/core/workers/chunks/{653ff3e631fea8ad393a.js → a0db1f3ca29e34dfa16f.js} +12 -12
- package/assets/esri/core/workers/chunks/{1cc5c566e68f2255d035.js → a6ca68ef6311ffc365b2.js} +1 -1
- package/assets/esri/core/workers/chunks/{5a51c75a2932d9da001a.js → a8d043b73e087bee7c40.js} +1 -1
- package/assets/esri/core/workers/chunks/{581180668e0229dcdc14.js → bf190d672dcbaedc1a41.js} +1 -1
- package/assets/esri/core/workers/chunks/{ebfa4a0334401f5e004a.js → c12765e0c8b44e349c2a.js} +1 -1
- package/assets/esri/core/workers/chunks/{afddb94ff4e1a70022c7.js → c3b2b05996e2008adbe3.js} +1 -1
- package/assets/esri/core/workers/chunks/{4fb4884d2de42792abe3.js → d1a9e8db5ba403abe721.js} +1 -1
- package/assets/esri/core/workers/chunks/d35cd309ba7bb8968a22.js +1 -0
- package/assets/esri/core/workers/chunks/{6e6422eda398774acbc7.js → d60da671aba70485050e.js} +1 -1
- package/assets/esri/core/workers/chunks/{7a8df1225abd54ff68ed.js → db298b292a4e43cba72d.js} +1 -1
- package/assets/esri/core/workers/chunks/{2bda2cfc6e81818d7d33.js → dcaeb57c69d432118604.js} +1 -1
- package/assets/esri/core/workers/chunks/{fb455fd89b74b70a6a2b.js → e613df03ceb39e29befa.js} +1 -1
- package/assets/esri/core/workers/chunks/{05d7d8ff3e4cbad32580.js → e8dcaa7837b6fe7bff20.js} +1 -1
- package/assets/esri/core/workers/chunks/ec1a4b82cbc44ba45f83.js +1 -0
- package/assets/esri/core/workers/chunks/ec778cc7a55068f51937.js +1 -0
- package/assets/esri/core/workers/chunks/{51339193abddfe37745d.js → f2b63597ae956db74eb3.js} +1 -1
- package/assets/esri/geometry/support/pe-wasm.wasm +0 -0
- package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +14 -1
- package/assets/esri/themes/base/widgets/_SelectionList.scss +34 -0
- package/assets/esri/themes/base/widgets/_SelectionToolbar.scss +6 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_en.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_en.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_en.json +1 -1
- package/chunks/Bufferer-CicaNej1.js +1 -1
- package/chunks/Distance2DCalculator-C1KHhZwD.js +1 -1
- package/chunks/Envelope.js +1 -1
- package/chunks/Envelope2D.js +1 -1
- package/chunks/GeodeticDistanceCalculator-CcF1gMZX.js +1 -1
- package/chunks/Geometry.js +1 -1
- package/chunks/GeometryCleaner-BEJM7I4l.js +1 -1
- package/chunks/OperatorClip.js +1 -1
- package/chunks/OperatorCrosses.js +1 -1
- package/chunks/OperatorCut.js +1 -1
- package/chunks/OperatorGeneralize.js +1 -1
- package/chunks/OperatorGeodesicBuffer.js +1 -1
- package/chunks/OperatorGeodeticArea.js +1 -1
- package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
- package/chunks/OperatorGeodeticDistance.js +1 -1
- package/chunks/OperatorGeodeticLength.js +1 -1
- package/chunks/OperatorIntersects.js +1 -1
- package/chunks/OperatorMultiPartToSinglePart.js +1 -1
- package/chunks/OperatorOverlaps.js +1 -1
- package/chunks/OperatorProximity.js +1 -1
- package/chunks/OperatorProximityGeodesic.js +1 -1
- package/chunks/OperatorShapePreservingLength.js +1 -1
- package/chunks/OperatorShapePreservingProject.js +1 -1
- package/chunks/OperatorSimplifyOGC.js +1 -1
- package/chunks/OperatorTouches.js +1 -1
- package/chunks/OperatorWithin.js +1 -1
- package/chunks/Point2D.js +1 -1
- package/chunks/ProjectionTransformation.js +1 -1
- package/chunks/QuadraticBezier.js +1 -1
- package/chunks/SideCalculator2D-BNwb5gvz.js +1 -1
- package/chunks/Transformation2D.js +1 -1
- package/chunks/containsOperator.js +1 -1
- package/chunks/disjointOperator.js +1 -1
- package/chunks/equalsOperator.js +1 -1
- package/chunks/pe-wasm.js +1 -1
- package/chunks/pe.js +1 -1
- package/geometry/coordinateFormatter.js +1 -1
- package/geometry/operators/extendOperator.js +1 -1
- package/geometry/operators/gx/operatorAlphaShape.js +1 -1
- package/geometry/operators/gx/operatorAutoComplete.js +1 -1
- package/geometry/operators/gx/operatorBuffer.js +1 -1
- package/geometry/operators/gx/operatorDifference.js +1 -1
- package/geometry/operators/gx/operatorGraphicBuffer.js +1 -1
- package/geometry/operators/gx/operatorIntegrate.js +1 -1
- package/geometry/operators/gx/operatorIntersection.js +1 -1
- package/geometry/operators/gx/operatorLabelPoint.js +1 -1
- package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
- package/geometry/operators/gx/operatorLocateBetween.js +1 -1
- package/geometry/operators/gx/operatorMinimumBoundingCircle.js +1 -1
- package/geometry/operators/gx/operatorOffset.js +1 -1
- package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
- package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
- package/geometry/operators/gx/operatorSimplify.js +1 -1
- package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
- package/geometry/operators/gx/operatorUnion.js +1 -1
- package/geometry/operators/isNearOperator.js +1 -1
- package/geometry/operators/json/containsOperator.js +1 -1
- package/geometry/operators/json/disjointOperator.js +1 -1
- package/geometry/operators/reshapeOperator.js +1 -1
- package/geometry/operators/support/apiConverter.js +1 -1
- package/geometry/operators/support/initNoPeFactory.js +1 -1
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/geometry/support/WKIDUnitConversion.js +1 -1
- package/interfaces.d.ts +31 -0
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/utils.js +1 -1
- package/views/3d/interactive/Manipulator3D.js +1 -1
- package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
- package/views/3d/layers/DrapedSubView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/MediaLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/LodRenderer.js +1 -1
- package/views/3d/support/StreamTextureCollection.js +1 -1
- package/views/3d/support/TextureCollection.js +1 -1
- package/views/3d/webgl-engine/Stage.js +1 -1
- package/views/3d/webgl-engine/lib/ModelDirtySet.js +1 -1
- package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
- package/views/3d/webgl-engine/lib/Texture.js +1 -1
- package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
- package/views/3d/webgl-engine/lib/WebGLLayer.js +1 -1
- package/views/3d/webgl-engine/parts/Model.js +1 -1
- package/widgets/Directions/css.js +5 -0
- package/widgets/Directions.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +5 -0
- package/widgets/OrientedImageryViewer/components/ImageMeasurementWidget.js +1 -1
- package/widgets/OrientedImageryViewer/css.js +1 -1
- package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
- package/widgets/OrientedImageryViewer/mixins/SketchHandlerMixin.js +1 -1
- package/widgets/OrientedImageryViewer/mixins/TriangulatedImageMeasurementMixin.js +5 -0
- package/widgets/OrientedImageryViewer/mixins/TriangulatedSketchHandlerMixin.js +5 -0
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/support/SelectionList/LayerItem.js +1 -1
- package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
- package/widgets/support/SelectionList/VisibleElements.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
- package/widgets/support/SelectionToolbar/VisibleElements.js +5 -0
- package/widgets/support/SelectionToolbar.js +1 -1
- package/widgets/support/Selector2D/SelectionOperation.js +1 -1
- package/assets/esri/core/workers/chunks/11b55e7e76e50fe11bbe.js +0 -1
- package/assets/esri/core/workers/chunks/7bfa18dd8771d4932533.js +0 -1
- package/assets/esri/core/workers/chunks/84d7ed2cf5fe23a0888f.js +0 -1
- package/assets/esri/core/workers/chunks/86931186095c23e47c0c.js +0 -1
- package/assets/esri/core/workers/chunks/a79511b926a2830bb160.js +0 -1
- package/assets/esri/core/workers/chunks/e3ef0451dcdc2e966628.js +0 -1
- package/views/3d/webgl-engine/lib/ContentObject.js +0 -5
- package/views/3d/webgl-engine/lib/ContentObjectType.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{prefersReducedMotion as t}from"../core/a11yUtils.js";import{createTask as i}from"../core/asyncUtils.js";import a from"../core/Collection.js";import{deprecatedProperty as s}from"../core/deprecate.js";import o from"../core/Logger.js";import{isAbortError as r}from"../core/promiseUtils.js";import{watch as l,initial as n,syncAndInitial as c,whenOnce as d}from"../core/reactiveUtils.js";import{property as g}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{or as h}from"../layers/orientedImagery/transformations/utils.js";import p from"./Widget.js";import{getAllArcPath as u}from"./OrientedImageryViewer/arcUtils.js";import{defaultImageGeometryField as v,defaultOIObjectIDField as y,segmentArcs as w,sectorsRadii as _,featureCircleRadius as b,navigationToolDimensionLength as C,getDelegatedEvents as M}from"./OrientedImageryViewer/constants.js";import{css as T,navigation as I,navigationToolRotationFrom as f,navigationToolRotationTo as L,root as k}from"./OrientedImageryViewer/css.js";import{isFeatureAttachment as A,loadImageForAttachment as O,getThumbnailPixelBlock as F,renderImageWithRotation as S}from"./OrientedImageryViewer/galleryUtils.js";import E from"./OrientedImageryViewer/OrientedImageryViewerViewModel.js";import V from"./OrientedImageryViewer/OrientedImageryViewerVisibleElements.js";import P from"./OrientedImageryViewer/components/ImageLocationWidget.js";import x from"./OrientedImageryViewer/components/NavigationUI.js";import{loadCalciteComponents as G}from"./support/componentsUtils.js";import{globalCss as j}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as $}from"./support/decorators/messageBundle.js";import{vmEvent as D}from"./support/decorators/vmEvent.js";import{tsx as H}from"./support/jsxFactory.js";import{substitute as B}from"../intl/substitute.js";const N={overlayMapFeatures:"overlay-map-features",overlayed:"overlayed",overlaysActionHandles:"overlays-action-handles",directionsHandle:"directions-handle"};let U=class extends p{constructor(e,t){super(e,t),this.dataCaptureEnabled=!1,this.galleryOpened=!1,this.imageEnhancementToolActive=!1,this.directionToolsActive=!1,this.imageOverlaysOpened=!1,this.navigationToolActive=!1,this.viewModel=new E,this.messagesCommon=null,this.messagesSketch=null,this.pixelMeasurementUnit="meters",this.pixelAreaMeasurementUnit="square-meters",this.showCameraLocations=!1,this.showMapFeatures=!1,this.visibleElements=new V,this._imageOverlaysLoaderTask=null,this._imageMeasurementToolsLoaderTask=null,this._clearMeasurements=()=>{this.viewModel.measureType=null,this.viewModel.clearPreviousMeasurements()},this._clearImageLocation=()=>{this.imageLocationToolActive=!1},this._navigationToolExpanded=!1,this._navigationTool=null,this._warningTitleElement=null,this._galleryController=new AbortController,this._galleryObserver=new IntersectionObserver(this._lazyLoadImage.bind(this)),this._overlayedLayers=new a,this._previousAction=null,this._handleDataCaptureLayerChange=async e=>{if(this.dataCaptureLayer&&await this.stopDataCapture(!0),this.dataCaptureLayer=this.dataCaptureLayer===e?null:e,this.dataCaptureLayer)return this.startDataCapture(this.dataCaptureLayer)},this._handleOverlayLayerDeselect=e=>{const t=e.layer;t===this.dataCaptureLayer&&(this.stopDataCapture(),this.dataCaptureLayer=null),this.removeOverlayedGraphicsOnImage(`${t.id}`)},this._handleOverlayLayerSelect=e=>{const t=e.layer;this.viewModel.overlayMapFeatures(t,this.showMapFeatures),this.addHandles(l((()=>t.visible),(()=>{this.viewModel.toggleOverlayMapFeatures(t.id,t.visible)})),`${N.overlayed}-${t.id}`)},this._highlight=e=>{const t=e.target?.dataset.objectid;t&&this.viewModel.highlight(t)},this._onAction=e=>{const{target:t}=e,{dataset:{action:i}}=t,{_previousAction:a}=this,s=a?.dataset.action,o=s?.includes("draw")??!1,r="select-feature"===s,l=s!==i;switch(i){case"draw-point":case"draw-polygon":case"draw-polyline":{a&&h(r,o&&l)&&(a.active=!1),t.active=!t.active;const e=i.replace("draw-","");this.viewModel.digitizeCreate(e),this._previousAction=t.active?t:null;break}case"save":this.viewModel.saveDrawing();break;case"select-feature":o&&(this._previousAction.active=!1),t.active=!t.active,this.viewModel.toggleSelection(t.active),this._previousAction=t.active?t:null;break;case"delete-feature":this.viewModel.digitizeDelete()}},this._onImageOverlayClosed=()=>{this.imageOverlaysOpened=!1},this._onShowCameraLocationsChanged=e=>{this.showCameraLocations=e},this._onShowMapFeaturesChanged=e=>{this.showMapFeatures=e},this._removeHighlight=()=>this.viewModel.removeHighlight(),this._restoreOverlays=async()=>Promise.all(this._overlayedLayers.map((e=>this.viewModel.overlayMapFeatures(e,this.showMapFeatures)))),this._scaleNavigationTool=()=>{this._navigationToolExpanded=!this._navigationToolExpanded},this._sketchLoaderTask=null,this._toggleDirectionsTool=()=>{const e=this.directionToolsActive;this._closeAllImageTools(),this.directionToolsActive=!e},this._toggleImageAttributes=()=>{this.viewModel.toggleImageAttributes()},this._loadImageFromGallery=this._loadImageFromGallery.bind(this),this._registerGalleryItem=this._registerGalleryItem.bind(this),this._unregisterGalleryItem=this._unregisterGalleryItem.bind(this),this.loadImageFromSource=this.loadImageFromSource.bind(this),this.updateSuitabilities=this.updateSuitabilities.bind(this)}initialize(){this.addHandles([l((()=>[this.viewModel?.bestFeatureAngle,this._navigationTool]),(([e,t])=>{t&&this._updateNavigationTool(t)}),n),l((()=>this.currentCoverageVisible),(e=>this._onCurrentCoverageVisibilityChange(e))),l((()=>this.isAdditionalCoverageVisible),(e=>this._onAdditionalCoverageVisibilityChange(e))),l((()=>this.isAdditionalPointSourcesVisible),(e=>this._onAdditionalCameraLocationsVisibility(e))),l((()=>({features:this.currentBestFeature,showCameraLocations:this.showCameraLocations,state:this.viewModel.state})),(({showCameraLocations:e,state:t})=>{"image-loaded"===t&&this.viewModel.overlayCameraLocations(e)}),c),l((()=>({feature:this.currentBestFeature,showMapFeatures:this.showMapFeatures,state:this.viewModel.state})),(async(e,t)=>{if(e.showMapFeatures!==t?.showMapFeatures&&this.viewModel.toggleAllOverlayMapFeatures(e.showMapFeatures),null!=e.feature&&e.feature!==t?.feature){if(this.viewModel.removeAllOverlayMapFeatures(),await d((()=>"image-loaded"===this.viewModel.state)),this.dataCaptureLayer&&this.stopDataCapture(),await this._restoreOverlays(),!this.dataCaptureLayer)return;await this.startDataCapture(this.dataCaptureLayer),this._previousAction?.active&&(this._previousAction.active=!1,this._previousAction=null)}}),n)])}loadDependencies(){return G({"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),shell:()=>import("@esri/calcite-components/dist/components/calcite-shell"),dialog:()=>import("@esri/calcite-components/dist/components/calcite-dialog"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),slider:()=>import("@esri/calcite-components/dist/components/calcite-slider"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}destroy(){this._galleryController.abort(),this._galleryObserver.disconnect()}get accuracyParametersMissing(){return this.viewModel.accuracyParametersMissing}get activeLayer(){return s(o.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer}set activeLayer(e){s(o.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer=e}get currentBestFeature(){return this.viewModel.currentBestFeature}set currentBestFeature(e){this.viewModel.currentBestFeature=e}get currentCoverageVisible(){return this.viewModel.currentCoverageVisible}set currentCoverageVisible(e){this.viewModel.currentCoverageVisible=e}get dataCaptureLayer(){return this.viewModel.dataCaptureLayer}set dataCaptureLayer(e){this.viewModel.dataCaptureLayer=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get displayMessage(){return this.viewModel.displayMessage}get features(){return this.viewModel.features}get imagePointsInView(){return this.viewModel.imagePointsInView}get icon(){return"oriented-imagery-widget"}set icon(e){this._overrideIfSome("icon",e)}get imageGalleryEnabled(){return this.viewModel.imageGalleryEnabled}get imageLocationToolActive(){return this.viewModel.imageLocationToolState}set imageLocationToolActive(e){this.viewModel.imageLocationToolState=e}get invalidCameraHeading(){return this.viewModel.invalidCameraHeading}get isAdditionalCoverageVisible(){return this.viewModel.isAdditionalCoverageVisible}set isAdditionalCoverageVisible(e){this.viewModel.isAdditionalCoverageVisible=e}get isAdditionalPointSourcesVisible(){return this.viewModel.isAdditionalPointSourcesVisible}set isAdditionalPointSourcesVisible(e){this.viewModel.isAdditionalPointSourcesVisible=e}get mapImageConversionToolState(){return this.viewModel.mapImageConversionToolState}set mapImageConversionToolState(e){this.viewModel.mapImageConversionToolState=e}get measureType(){return this.viewModel.measureType}set measureType(e){this.viewModel.measureType=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get popupEnabled(){const{popupEnabled:e,state:t}=this.viewModel;return"image-loaded"===t&&e}get referencePoint(){return this.viewModel.referencePoint??null}get sketchViewModel(){return this.viewModel.sketch}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}set determineWorkflowForFeature(e){this.viewModel.determineWorkflowForFeature=e}get determineWorkflowForFeature(){return this.viewModel.determineWorkflowForFeature}set updateFootprint(e){this.viewModel.updateFootprint=e}get updateFootprint(){return this.viewModel.updateFootprint}_renderActionBar(){return H("calcite-action-bar",{expandDisabled:!0,layout:"horizontal",slot:"action-bar"},H("calcite-action-group",null,this._currentFootprintToggle(),this._additionalFootprintToggle(),this._additionalPointSourcesToggle()),H("calcite-action-group",null,this._mapImageConversionToggle(),this._navigationToolToggle(),this._directionToolToggle(),this._imageEnhancementsToggle()),H("calcite-action-group",null,this._measurementToolsToggle(),this._imageGalleryToggle(),this._imageOverlaysToggle(),this._openPopupAction()))}get _activeMeasurementIcon(){const{measureType:e,imageLocationToolActive:t}=this;if(t)return"pin-tear";switch(e){case"area":return"measure-area";case"height":return"measure-building-height-top-base";default:return"measure-line"}}get _activeMeasurementHeading(){const{measureType:e,messages:t}=this,{groundArea:i,heightAboveGround:a,groundDistance:s}=t;switch(e){case"area":return i;case"height":return a;default:return s}}_additionalFootprintToggle(){const{isAdditionalCoverageVisible:e,invalidCameraHeading:t,visibleElements:{additionalFootprintToggle:i}}=this;return i?H("calcite-action",{active:e,bind:this,class:T.addCoverage,disabled:t,icon:"trapezoid-area",onclick:this._toggleAdditionalCoverage,text:this.messages.additionalFootprints,title:this.messages.additionalFootprints}):null}_additionalPointSourcesToggle(){const{isAdditionalPointSourcesVisible:e,invalidCameraHeading:t,visibleElements:{additionalCameraLocationsToggle:i}}=this;return i?H("calcite-action",{active:e,bind:this,class:T.addExpPoints,disabled:t,icon:"circle-area",onclick:this._toggleAdditionalCameraLocations,text:this.messages.additionalCameraLocations,title:this.messages.additionalCameraLocations}):null}get _measurementToggle(){const{viewModel:{state:e,measureType:t},id:i}=this;if("image-loaded"!==e||!t)return;this._imageMeasurementToolsLoaderTask||this._loadImageMeasurementResources();const a=this._imageMeasurementToolsLoaderTask?.value;return a?H("calcite-dialog",{bind:this,dragEnabled:!0,escapeDisabled:!0,heading:this._activeMeasurementHeading,id:`${i}-${t}-measurement`,open:!0,placement:"bottom-start",resizable:!0,scale:"s",slot:"dialogs",width:"s",onCalciteDialogBeforeClose:this._clearMeasurements},H(a,{measurementType:t,measurementUnitMessages:this.measurementUnitMessages,messages:this.messages,oiViewModel:this.viewModel})):null}get _renderRoot(){const{viewModel:{state:e}}=this;return H("calcite-panel",null,H("calcite-shell",null,H("calcite-panel",{bind:this,class:T.viewerContainer,heading:this.visibleElements.title?this.messages.title:void 0,loading:e.includes("loading")},this.visibleElements.menu?this._renderActionBar():null,this._imageViewer,this._panoramicViewer,this._messageBox,this.invalidCameraHeading?[this._renderWarning(this.messages.invalidCameraHeadingWarningTitle),this._renderWarningTooltip(this.messages.invalidCameraHeadingWarningDescription)]:[this._imageGalleryPanel,this._renderNavigation,this._imageOverlaysPanel()],this._imageEnhancementTools,this._renderNavigationUI,this._renderSketch()),this._measurementToggle,this._locationToggle))}_currentFootprintToggle(){const{currentCoverageVisible:e,invalidCameraHeading:t}=this,{currentFootprintToggle:i}=this.visibleElements;return i?H("calcite-action",{active:e,bind:this,class:T.currentCoverage,disabled:t,icon:"trapezoid-area",onclick:this._toggleCurrentCoverage,text:this.messages.currentFootprint,title:this.messages.currentFootprint}):null}get _imageEnhancementTools(){const{imageEnhancementToolActive:e,viewModel:{brightness:t,contrast:i,sharpness:a,state:s}}=this;return e&&"image-loaded"===s?H("calcite-panel",{bind:this,class:T.imageEnhancementWrapper,closable:!0,closed:!e,heading:this.messages.imageEnhancement,key:this.messages.imageEnhancement,onCalcitePanelClose:this._toggleImageEnhancementToolState},H("div",{class:T.imageEnhancementTools},H("div",{class:T.imageEnhancementToolContainer},H("calcite-label",null,this.messages.brightness,H("calcite-slider",{bind:this,labelTicks:!0,max:10,min:-10,ticks:5,value:t,onCalciteSliderInput:this._handleBrightnessChange}))),H("div",{class:T.imageEnhancementToolContainer},H("calcite-label",null,this.messages.contrast,H("calcite-slider",{bind:this,labelTicks:!0,max:10,min:-10,ticks:5,value:i,onCalciteSliderInput:this._handleContrastChange}))),H("div",{class:T.imageEnhancementToolContainer},H("calcite-label",null,this.messages.sharpness,H("calcite-slider",{bind:this,labelTicks:!0,max:1,min:0,step:.1,ticks:.5,value:a,onCalciteSliderInput:this._handleSharpnessChange})))),H("calcite-action",{bind:this,icon:"reset",onclick:this._resetImageTools,slot:"header-actions-end",text:this.messagesCommon.reset,title:this.messagesCommon.reset})):null}_imageEnhancementsToggle(){const{state:e,mode:t}=this.viewModel,{imageEnhancement:i}=this.visibleElements;return i?H("calcite-action",{active:this.imageEnhancementToolActive,bind:this,disabled:"default"!==t||"image-loaded"!==e,icon:"sliders-horizontal",onclick:this._toggleImageEnhancementToolState,text:this.messages.imageEnhancement,title:this.messages.imageEnhancement}):null}get _imageGalleryPanel(){const{container:e,galleryOpened:t,imageGalleryEnabled:i}=this;return i&&t&&e?this._imageGalleryContext:null}get _imageGalleryContext(){const{galleryOpened:e,invalidCameraHeading:t}=this;return H("calcite-panel",{bind:this,class:T.carousel,closable:!0,closed:!e,disabled:t,heading:this.messages.imageGallery,key:this.messages.imageGallery,onCalcitePanelClose:this._toggleImageGallery},H("div",{class:T.carouselContainer},this._renderThumbnails))}_imageGalleryToggle(){const{imageGalleryEnabled:e,invalidCameraHeading:t,visibleElements:{imageGallery:i}}=this;return i?H("calcite-action",{active:this.galleryOpened,bind:this,disabled:!e||t,icon:"images",onclick:this._toggleImageGallery,text:this.messages.imageGallery,title:this.messages.imageGallery}):null}get _imageOverlaysComponent(){const{_imageOverlayMessages:e,_imageOverlaysLoaderTask:t,_overlayedLayers:a,dataCaptureEnabled:s,dataCaptureLayer:o,imageOverlaysOpened:r,showCameraLocations:l,showMapFeatures:n,view:c,layer:d}=this;if(!d)return null;const g=d.imageGeometryField?.length?d.imageGeometryField:v,m=d.imageReferenceField?.length?d.imageReferenceField:y;t||(this._imageOverlaysLoaderTask=i((async()=>(await import("./OrientedImageryViewer/components/ImageOverlays.js")).default)));const h=this._imageOverlaysLoaderTask?.value;return h?H(h,{closed:!r,dataCaptureEnabled:s,dataCaptureLayer:o,imageGeometryField:g,imageReferenceField:m,messages:e,overlayedLayers:a,showCameraLocations:l,showMapFeatures:n,view:c,onDataCaptureLayerChanged:this._handleDataCaptureLayerChange,onImageOverlaysClosed:this._onImageOverlayClosed,onLayerDeselected:this._handleOverlayLayerDeselect,onLayerSelected:this._handleOverlayLayerSelect,onShowCameraLocationsChanged:this._onShowCameraLocationsChanged,onShowMapFeaturesChanged:this._onShowMapFeaturesChanged}):null}get _imageOverlayMessages(){return{...this.messages,...this.messagesSketch}}get _imageSketchToolsMessages(){return{...this.messagesSketch,...this.messagesCommon}}_imageOverlaysPanel(){const{imageOverlaysOpened:e,viewModel:{state:t}}=this,i=this.classes({[T.imageOverlaysContainer]:!0,[j.hidden]:!e||"image-loaded"!==t});return H("div",{class:i,key:this.messages.imageOverlays},this._imageOverlaysComponent)}_imageOverlaysToggle(){const{viewModel:{state:e},imageOverlaysOpened:t,invalidCameraHeading:i,visibleElements:{imageOverlays:a}}=this;return a?H("calcite-action",{active:t,bind:this,disabled:"image-loaded"!==e||i,icon:"layers",onclick:this._toggleImageOverlays,text:this.messages.imageOverlays,title:this.messages.imageOverlays}):null}get _imageViewer(){const{displayMessage:e,loadImageViewer:t,mode:i}=this.viewModel,a=null!=e||"default"!==i,s=this.classes({[T.viewer]:!a,[T.viewerHidden]:a});return H("calcite-panel",{afterCreate:t,bind:this,class:s},this._renderSketch())}get _locationToggle(){const{viewModel:{state:e,groundCoordinates:t,groundCoordinatesAccuracy:i},imageLocationToolActive:a,messages:{groundLocation:s}}=this;if("image-loaded"===e&&t&&a)return H("calcite-dialog",{bind:this,dragEnabled:!0,escapeDisabled:!0,heading:s,id:s,open:!0,placement:"bottom-start",resizable:!0,scale:"s",slot:"dialogs",width:"s",onCalciteDialogBeforeClose:this._clearImageLocation},H(P,{accuracy:i,groundCoordinates:t,messages:this.messages}))}_mapImageConversionToggle(){const{mapImageConversionToolState:e,viewModel:{state:t},invalidCameraHeading:i,visibleElements:{mapImageConversionTool:a}}=this;return a?H("calcite-action",{active:e,bind:this,disabled:"image-loaded"!==t||i,icon:"image-pin",onclick:this._toggleMapImageConversionToolState,text:this.messages.mapImageConversionTool,title:this.messages.mapImageConversionTool}):null}_measurementToolsToggle(){const{_activeMeasurementIcon:e,measureType:t,viewModel:i,accuracyParametersMissing:a,messages:s,visibleElements:{measurementTools:o}}=this,{state:r}=i,{measurementTools:l,groundDistance:n,groundArea:c,heightAboveGround:d,groundLocation:g}=s;return o?H("calcite-dropdown",{disabled:a,key:"measurement-tools",title:l,width:"m"},H("calcite-action",{bind:this,disabled:"image-loaded"!==r||a,icon:e,slot:"trigger",text:l}),H("calcite-dropdown-group",null,H("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"measure-line",key:"distance-measurement",onclick:e=>this._toggleMeasurementSketch(e,"distance"),selected:"distance"===t},n),H("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"measure-area",key:"area-measurement",onclick:e=>this._toggleMeasurementSketch(e,"area"),selected:"area"===t},c),H("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"measure-building-height-top-base",key:"height-dropdown",onclick:e=>this._toggleMeasurementSketch(e,"height"),selected:"height"===t},d),H("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"pin-tear",key:"surface-location",onclick:e=>this._toggleLocationTool(e),selected:this.imageLocationToolActive},g))):null}get _messageBox(){const{messages:e,viewModel:{displayMessage:t}}=this;if(!t)return null;const{data:i,key:a,map:s}=t,o=`${s?B(e[a],s):e[a]}`;return H("span",{class:T.messageBox},i?`${o} ${i}`:o)}_navigationToolToggle(){const{state:e}=this.viewModel,{visibleElements:{navigationTool:t}}=this;return t?H("calcite-action",{active:this.navigationToolActive,bind:this,disabled:"image-loaded"!==e||this.invalidCameraHeading,icon:"explore",onclick:this._toggleNavigationTool,text:this.messages.navigationTool,title:this.messages.navigationTool}):null}_directionToolToggle(){const{state:e,mode:t}=this.viewModel,{visibleElements:{directions:i}}=this;return i?H("calcite-action",{active:this.directionToolsActive,bind:this,disabled:"image-loaded"!==e||this.invalidCameraHeading||"panoramic"!==t,icon:"tour",onclick:this._toggleDirectionsTool,text:this.messages.imageNavigation,title:this.messages.imageNavigation}):null}_openPopupAction(){const{showPopupsAction:e}=this.visibleElements;return e?H("calcite-action",{bind:this,disabled:!this.popupEnabled,icon:"popup",onclick:this._toggleImageAttributes,text:this.messages.showPopups,title:this.messages.showPopups}):null}get _panoramicViewer(){const{displayMessage:e,loadPanoramicViewer:t,mode:i}=this.viewModel,a=null!=e||"panoramic"!==i,s=this.classes({[T.viewer]:!a,[T.viewerHidden]:a});return H("calcite-panel",{afterCreate:t,bind:this,class:s})}get _renderNavigationUI(){const{visibleElements:{directions:e},directionToolsActive:t,viewModel:i}=this;return"image-loaded"===i.state&&e&&t&&"panoramic"===i.mode?H(x,{currentNode:this.viewModel.currentNode,navigate:this.viewModel.navigate,nodes:this.viewModel.navigationNodes}):null}_closeAllImageTools(){this.imageEnhancementToolActive=!1,this.navigationToolActive=!1,this.imageOverlaysOpened=!1,this.galleryOpened=!1,this.measureType=null,this.imageLocationToolActive=!1,this.directionToolsActive=!1}_handleBrightnessChange(e){this.viewModel.brightness=e.currentTarget.value??0}_handleContrastChange(e){this.viewModel.contrast=e.currentTarget.value??0}_handleSharpnessChange(e){this.viewModel.sharpness=e.currentTarget.value??0}_lazyLoadImage(e,t){e.forEach((async e=>{if(e.isIntersecting){const a=e.target,s=a.getAttribute("data-src"),l=a.getAttribute("data-rotation"),n=a.getAttribute("data-objectid"),c=l?parseFloat(l)%360:0,{layer:d,_galleryController:{signal:g}}=this;if(!s||!n)return;let m;try{m=A(s)?await O(d,n,{signal:g}):await F(s,{signal:g})}catch(i){r(i)||o.getLogger("esri.widgets.OrientedImageryViewer").error("#lazyLoadImage()",i)}finally{t.unobserve(a)}if(!m)return;S(m,a,c)}}))}_loadImageFromGallery(e){const{target:t}=e;if(!t)return;const i=t.getAttribute("data-objectid");i&&this.viewModel.currentBestFeature?.attributes.objectId!==Number(i)&&this.viewModel.selectBestFeature(i)}_loadImageMeasurementResources(){this._imageMeasurementToolsLoaderTask=i((async()=>{const{default:e}=await import("./OrientedImageryViewer/components/ImageMeasurementWidget.js");return e}))}_loadSketchResources(){this._sketchLoaderTask=i((async()=>(await import("./OrientedImageryViewer/components/SketchTools.js")).default))}_onAdditionalCoverageVisibilityChange(e){this.viewModel.setAdditionalCoverageVisibility(e)}_onAdditionalCameraLocationsVisibility(e){this.viewModel.setAdditionalCameraLocationsVisibility(e)}_onCurrentCoverageVisibilityChange(e){this.viewModel.setCurrentCoverageVisibility(e)}_registerGalleryItem(e){this._galleryObserver.observe(e)}_renderWarning(e){const{invalidCameraHeading:t,viewModel:{state:i}}=this;return t&&"image-loaded"===i?[H("calcite-notice",{class:T.alert,closable:!0,icon:"exclamation-mark-triangle-f",iconFlipRtl:!0,kind:"warning",open:!0,scale:"s"},H("div",{afterCreate:e=>this._storeWarningTitleElement(e),slot:"title"},e))]:null}_renderWarningTooltip(e){const{_warningTitleElement:t}=this;if(e?.length&&t)return H("calcite-tooltip",{closeOnClick:!0,referenceElement:t},e)}get _renderNavigation(){const{viewModel:{sectorData:e,navigatorCurrentBestFeature:i,currentBestFeature:a,state:s}}=this;if(!this.container||!a)return null;let o,r,l,n,c;if(i){const{x:e,y:t,direction:a}=i,[s,d,g,m]=w[a];o=`M ${e} ${t} L ${s} ${d} A ${_[2]} ${_[2]} 0 0 1 ${g} ${m} Z`,r=e,n=t,l=w[a][4],c=w[a][5]}const d=e=>{const t=e.target.dataset?.sector;t&&this.viewModel.handleSectorClick(+t)},g=e=>{const t=e.target.dataset;if(!t)return;const{featureIndexInSector:i,sector:a}=t;i&&a&&this.viewModel.handleFeatureClick({sector:a,featureIndexInSector:+i})},m=e=>{e.removeEventListener("click",g)},h=a.attributes.objectId,p=e?.map((e=>e?.items)).filter(Boolean).flatMap((e=>e?.map((({x:e,y:t,objectID:i,featureIndexInSector:a,sector:s})=>H("circle",{afterRemoved:m,class:this.classes(T.feature,{selected:h===i}),cx:e,cy:t,"data-feature-index-in-sector":a,"data-sector":s,key:`${T.feature}-${i}`,onclick:g,r:b}))))),v=e=>{e.removeEventListener("click",d)},y=this.classes({[T.navigationWrapper]:!0,[T.navigationZoomed]:this._navigationToolExpanded});return this.navigationToolActive&&"image-loaded"===s?H("div",{bind:this,class:y,key:this.messages.navigationTool},H("svg",{afterCreate:e=>this._storeNavigationToolReference(e),class:t()?I:T.rotateWithAnimation,focusable:"false",height:C,role:"img",width:C,xmlns:"http://www.w3.org/2000/svg"},H("defs",null,H("linearGradient",{gradientUnits:"userSpaceOnUse",id:`${this.id}-coverage-fill`,x1:r,x2:l,y1:n,y2:c},H("stop",{class:T.navigationPathOffset0,offset:0}),H("stop",{class:T.navigationPathOffset1,offset:1}))),H("g",null,H("circle",{class:this.classes(T.sector,T.outerSector),cx:_[3],cy:_[3],onclick:this._scaleNavigationTool,r:_[3]}),H("circle",{class:T.sector,cx:_[3],cy:_[3],r:_[2]}),H("circle",{class:T.sector,cx:_[3],cy:_[3],r:_[1]}),H("circle",{class:T.sector,cx:_[3],cy:_[3],r:_[0]}),H("path",{class:T.pointer,d:"M 56.5 6.06217782649107 L 60 0 L 63.5 6.06217782649107 Z",key:`${T.pointer}-west`}),H("path",{class:this.classes(T.pointer,T.north),d:"M 113.93782217350893 56.5 L 120 60 L 113.93782217350893 63.5 Z",key:`${T.pointer}-north`}),H("path",{class:T.pointer,d:"M 56.5 113.93782217350893 L 60 120 L 63.5 113.93782217350893 Z",key:`${T.pointer}-east`}),H("path",{class:T.pointer,d:"M 6.06217782649107 56.5 L 0 60 L 6.06217782649107 63.5 Z",key:`${T.pointer}-south`}),H("path",{class:this.classes(T.sector,T.sectorSeparator),d:"M 23.937554159486076 23.937554159486076 L 96.06244584051393 96.06244584051393 M 23.937554159486076 96.06244584051393 L 96.06244584051393 23.937554159486076",key:T.sectorSeparator}),u([_[2],_[1],_[0]],_[3],_[3]).map(((t,i)=>H("path",{afterRemoved:v,class:this.classes(T.sector,e?.[i]?.length?T.sectorEnabled:T.sectorDisabled),d:t,"data-sector":`${i}`,key:`${T.sector}-${i}`,onclick:d}))),H("path",{class:this.classes(T.sector,T.sectorCross),d:"M 56.4 56.4 L 63.53 63.53 M 63.53 56.4 L 56.4 63.53",key:T.sectorCross}),p,a.attributes.cameraPitch>=5&&o?H("path",{class:T.selectedFeaturePath,d:o,fill:`url(#${this.id}-coverage-fill)`,key:T.selectedFeaturePath}):null))):null}_renderSketch(){const{dataCaptureLayer:e,imageOverlaysOpened:t}=this;if(!e||t)return null;if(this._sketchLoaderTask||this._loadSketchResources(),!this._sketchLoaderTask?.value)return null;const{geometryType:i}=e,a="point"===i?"pin":"polyline"===i?"line":"polygon",s=this._sketchLoaderTask.value;return H("div",{class:T.sketchTools},H(s,{icon:a,messages:this._imageSketchToolsMessages,type:i,onAction:this._onAction}))}get _renderThumbnails(){const{currentBestFeature:e,thumbnails:t}=this.viewModel;return e?H("div",{class:T.carouselContent},t?.items.map((({url:t,objectId:i,rotation:a},s)=>H("div",{class:`${T.carouselItemWrapper}${e.attributes.objectId===i?"--selected":""}`,key:`${T.carouselItemWrapper}-${s}`},H("canvas",{afterCreate:this._registerGalleryItem,afterRemoved:this._unregisterGalleryItem,alt:`thumbnail-${i}`,class:T.carouselItem,"data-objectid":`${i}`,"data-rotation":`${a}`,"data-src":t,onclick:this._loadImageFromGallery,onmouseenter:this._highlight,onmouseleave:this._removeHighlight}))))):null}_resetImageTools(){this.viewModel.sharpness=this.viewModel.brightness=this.viewModel.contrast=0}_storeNavigationToolReference(e){this._navigationTool=e}_storeWarningTitleElement(e){this._warningTitleElement=e}_toggleAdditionalCameraLocations(){this.isAdditionalPointSourcesVisible=!this.isAdditionalPointSourcesVisible}_toggleAdditionalCoverage(){this.isAdditionalCoverageVisible=!this.isAdditionalCoverageVisible}_toggleCurrentCoverage(){this.currentCoverageVisible=!this.currentCoverageVisible}_toggleImageEnhancementToolState(e){e.stopPropagation();const t=this.imageEnhancementToolActive;this._closeAllImageTools(),this.imageEnhancementToolActive=!t}_toggleImageOverlays(e){e.stopPropagation();const t=this.imageOverlaysOpened;this._closeAllImageTools(),this.imageOverlaysOpened=!t}_toggleImageGallery(e){e.stopPropagation();const t=this.galleryOpened;this._closeAllImageTools(),this.galleryOpened=!!this.imageGalleryEnabled&&!t}_toggleLocationTool(e){const t=this.imageLocationToolActive;this._closeAllImageTools(),this.imageLocationToolActive=!t,e.stopPropagation()}_toggleMeasurementSketch(e,t){e.stopPropagation();const i=this.measureType;this._closeAllImageTools(),this.measureType=i===t?null:t,this.measureType===t&&(this.viewModel.displayNewMeasurementButton=!0)}_toggleNavigationTool(){const e=this.navigationToolActive;this._closeAllImageTools(),this.navigationToolActive=!e}_toggleMapImageConversionToolState(){this.mapImageConversionToolState=!this.mapImageConversionToolState}_unregisterGalleryItem(e){this._galleryObserver.unobserve(e)}_updateNavigationTool(e){const{previousFeatureAngle:t,bestFeatureAngle:i}=this.viewModel,a=(i-t+540)%360-180;e.style.setProperty(f,`${t}deg`),e.style.setProperty(L,`${t+a}deg`)}async loadBestImage(e){return this.viewModel.loadBestImage(e)}loadImageFromSource(e,t){return this.viewModel.loadImageFromSource(e,t)}async overlayMapFeatures(e,t){return this.removeHandles(`${N.overlayed}-${e.id}`),this.addHandles(l((()=>e.visible),(()=>{this.viewModel.toggleOverlayMapFeatures(e.id,e.visible)})),`${N.overlayed}-${e.id}`),this._overlayedLayers.add(e),this.viewModel.overlayMapFeatures(e,t&&this.showMapFeatures)}async plotMapPoint(e){return this.viewModel.plotMapPoint(e)}plotReferencePointOnGround(e){this.viewModel.plotReferencePointOnGround(e)}plotReferencePointOnImage(e){this.viewModel.plotReferencePointOnImage(e)}removeOverlayedGraphicsOnImage(e){this.removeHandles(`${N.overlayed}-${e}`),this._overlayedLayers.remove(this._overlayedLayers.find((t=>t.id===e))),this.viewModel.removeOverlayedGraphicsOnImage(e)}resetImage(){this.viewModel.resetImage()}render(){return H("div",{class:this.classes(j.widget,k)},this._renderRoot)}async startDataCapture(e){return this.viewModel.startDataCapture(e)}async stopDataCapture(e){return this.viewModel.stopDataCapture(e)}updateSuitabilities(e){this.viewModel.updateSuitabilities(e)}};e([g({readOnly:!0})],U.prototype,"accuracyParametersMissing",null),e([g()],U.prototype,"activeLayer",null),e([g()],U.prototype,"currentBestFeature",null),e([g()],U.prototype,"currentCoverageVisible",null),e([g()],U.prototype,"dataCaptureEnabled",void 0),e([g()],U.prototype,"dataCaptureLayer",null),e([g()],U.prototype,"disabled",null),e([g()],U.prototype,"features",null),e([g()],U.prototype,"imagePointsInView",null),e([g()],U.prototype,"galleryOpened",void 0),e([g()],U.prototype,"icon",null),e([g()],U.prototype,"imageEnhancementToolActive",void 0),e([g({readOnly:!0})],U.prototype,"imageGalleryEnabled",null),e([g()],U.prototype,"imageLocationToolActive",null),e([g()],U.prototype,"directionToolsActive",void 0),e([g()],U.prototype,"imageOverlaysOpened",void 0),e([g({readOnly:!0})],U.prototype,"invalidCameraHeading",null),e([g()],U.prototype,"isAdditionalCoverageVisible",null),e([g()],U.prototype,"isAdditionalPointSourcesVisible",null),e([g()],U.prototype,"mapImageConversionToolState",null),e([g()],U.prototype,"measureType",null),e([g()],U.prototype,"layer",null),e([g()],U.prototype,"navigationToolActive",void 0),e([D(M()),g({type:E})],U.prototype,"viewModel",void 0),e([g(),$("esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer")],U.prototype,"messages",void 0),e([g(),$("esri/core/t9n/Units")],U.prototype,"measurementUnitMessages",void 0),e([g(),$("esri/t9n/common")],U.prototype,"messagesCommon",void 0),e([g(),$("esri/widgets/Sketch/t9n/Sketch")],U.prototype,"messagesSketch",void 0),e([g()],U.prototype,"pixelMeasurementUnit",void 0),e([g()],U.prototype,"pixelAreaMeasurementUnit",void 0),e([g({readOnly:!0})],U.prototype,"popupEnabled",null),e([g()],U.prototype,"referencePoint",null),e([g()],U.prototype,"showCameraLocations",void 0),e([g()],U.prototype,"showMapFeatures",void 0),e([D(["create","delete","redo","undo","update"]),g({readOnly:!0})],U.prototype,"sketchViewModel",null),e([g()],U.prototype,"view",null),e([g({type:V,nonNullable:!0})],U.prototype,"visibleElements",void 0),e([g()],U.prototype,"determineWorkflowForFeature",null),e([g()],U.prototype,"updateFootprint",null),e([g()],U.prototype,"_activeMeasurementIcon",null),e([g()],U.prototype,"_activeMeasurementHeading",null),e([g()],U.prototype,"_imageOverlaysLoaderTask",void 0),e([g()],U.prototype,"_imageMeasurementToolsLoaderTask",void 0),e([g()],U.prototype,"_measurementToggle",null),e([g()],U.prototype,"_renderRoot",null),e([g()],U.prototype,"_imageEnhancementTools",null),e([g()],U.prototype,"_imageGalleryPanel",null),e([g()],U.prototype,"_imageGalleryContext",null),e([g()],U.prototype,"_imageOverlaysComponent",null),e([g()],U.prototype,"_imageOverlayMessages",null),e([g()],U.prototype,"_imageSketchToolsMessages",null),e([g()],U.prototype,"_imageViewer",null),e([g()],U.prototype,"_locationToggle",null),e([g()],U.prototype,"_messageBox",null),e([g()],U.prototype,"_navigationToolExpanded",void 0),e([g()],U.prototype,"_navigationTool",void 0),e([g()],U.prototype,"_panoramicViewer",null),e([g()],U.prototype,"_renderNavigationUI",null),e([g()],U.prototype,"_warningTitleElement",void 0),e([g()],U.prototype,"_renderNavigation",null),e([g()],U.prototype,"_renderThumbnails",null),e([g()],U.prototype,"_sketchLoaderTask",void 0),U=e([m("esri.widgets.OrientedImageryViewer")],U);const R=U;export{R as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{prefersReducedMotion as t}from"../core/a11yUtils.js";import{createTask as i}from"../core/asyncUtils.js";import a from"../core/Collection.js";import{deprecatedProperty as s}from"../core/deprecate.js";import o from"../core/Logger.js";import{isAbortError as r}from"../core/promiseUtils.js";import{watch as n,initial as l,syncAndInitial as c,whenOnce as d}from"../core/reactiveUtils.js";import{property as g}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{or as h}from"../layers/orientedImagery/transformations/utils.js";import u from"./Widget.js";import{getAllArcPath as p}from"./OrientedImageryViewer/arcUtils.js";import{defaultImageGeometryField as v,defaultOIObjectIDField as y,segmentArcs as w,sectorsRadii as _,featureCircleRadius as b,navigationToolDimensionLength as M,getDelegatedEvents as T}from"./OrientedImageryViewer/constants.js";import{css as C,navigation as I,navigationToolRotationFrom as f,navigationToolRotationTo as A,root as L}from"./OrientedImageryViewer/css.js";import{isFeatureAttachment as k,loadImageForAttachment as O,getThumbnailPixelBlock as S,renderImageWithRotation as F}from"./OrientedImageryViewer/galleryUtils.js";import E from"./OrientedImageryViewer/OrientedImageryViewerViewModel.js";import V from"./OrientedImageryViewer/OrientedImageryViewerVisibleElements.js";import P from"./OrientedImageryViewer/components/ImageLocationWidget.js";import x from"./OrientedImageryViewer/components/ImageViewer.js";import G from"./OrientedImageryViewer/components/NavigationUI.js";import{loadCalciteComponents as j}from"./support/componentsUtils.js";import{globalCss as $}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as D}from"./support/decorators/messageBundle.js";import{vmEvent as H}from"./support/decorators/vmEvent.js";import{tsx as B,tsxFragment as N}from"./support/jsxFactory.js";import{substitute as U}from"../intl/substitute.js";const R={overlayMapFeatures:"overlay-map-features",overlayed:"overlayed",overlaysActionHandles:"overlays-action-handles",directionsHandle:"directions-handle"};let W=class extends u{constructor(e,t){super(e,t),this.dataCaptureEnabled=!1,this.galleryOpened=!1,this.imageEnhancementToolActive=!1,this.directionToolsActive=!1,this.imageOverlaysOpened=!1,this.navigationToolActive=!1,this.viewModel=new E,this.messagesCommon=null,this.messagesSketch=null,this.pixelMeasurementUnit="meters",this.pixelAreaMeasurementUnit="square-meters",this.showCameraLocations=!1,this.showMapFeatures=!1,this.visibleElements=new V,this._imageOverlaysLoaderTask=null,this._imageMeasurementToolsLoaderTask=null,this._clearMeasurements=()=>{this.viewModel.measureType=null,this.viewModel.clearPreviousMeasurements()},this._clearImageLocation=()=>{this.imageLocationToolActive=!1},this._navigationToolExpanded=!1,this._navigationTool=null,this._warningTitleElement=null,this._galleryController=new AbortController,this._galleryObserver=new IntersectionObserver(this._lazyLoadImage.bind(this)),this._overlayedLayers=new a,this._previousAction=null,this._handleDataCaptureLayerChange=async e=>{if(this.dataCaptureLayer&&await this.stopDataCapture(!0),this.dataCaptureLayer=this.dataCaptureLayer===e?null:e,this.dataCaptureLayer)return this.startDataCapture(this.dataCaptureLayer)},this._handleOverlayLayerDeselect=e=>{const t=e.layer;t===this.dataCaptureLayer&&(this.stopDataCapture(),this.dataCaptureLayer=null),this.removeOverlayedGraphicsOnImage(`${t.id}`)},this._handleOverlayLayerSelect=e=>{const t=e.layer;this.viewModel.overlayMapFeatures(t,this.showMapFeatures),this.addHandles(n((()=>t.visible),(()=>{this.viewModel.toggleOverlayMapFeatures(t.id,t.visible)})),`${R.overlayed}-${t.id}`)},this._highlight=e=>{const t=e.target?.dataset.objectid;t&&this.viewModel.highlight(t)},this._onAction=e=>{const{target:t}=e,{dataset:{action:i}}=t,{_previousAction:a}=this,s=a?.dataset.action,o=s?.includes("draw")??!1,r="select-feature"===s,n=s!==i;switch(i){case"draw-point":case"draw-polygon":case"draw-polyline":{a&&h(r,o&&n)&&(a.active=!1),t.active=!t.active;const e=i.replace("draw-","");this.viewModel.digitizeCreate(e),this._previousAction=t.active?t:null;break}case"save":this.viewModel.saveDrawing();break;case"select-feature":o&&(this._previousAction.active=!1),t.active=!t.active,this.viewModel.toggleSelection(t.active),this._previousAction=t.active?t:null;break;case"delete-feature":this.viewModel.digitizeDelete()}},this._onImageOverlayClosed=()=>{this.imageOverlaysOpened=!1},this._onShowCameraLocationsChanged=e=>{this.showCameraLocations=e},this._onShowMapFeaturesChanged=e=>{this.showMapFeatures=e},this._removeHighlight=()=>this.viewModel.removeHighlight(),this._restoreOverlays=async()=>Promise.all(this._overlayedLayers.map((e=>this.viewModel.overlayMapFeatures(e,this.showMapFeatures)))),this._scaleNavigationTool=()=>{this._navigationToolExpanded=!this._navigationToolExpanded},this._sketchLoaderTask=null,this._toggleDirectionsTool=()=>{const e=this.directionToolsActive;this._closeAllImageTools(),this.directionToolsActive=!e},this._toggleImageAttributes=()=>{this.viewModel.toggleImageAttributes()},this._loadImageFromGallery=this._loadImageFromGallery.bind(this),this._registerGalleryItem=this._registerGalleryItem.bind(this),this._unregisterGalleryItem=this._unregisterGalleryItem.bind(this),this.loadImageFromSource=this.loadImageFromSource.bind(this),this.updateSuitabilities=this.updateSuitabilities.bind(this)}initialize(){this.addHandles([n((()=>[this.viewModel?.bestFeatureAngle,this._navigationTool]),(([e,t])=>{t&&this._updateNavigationTool(t)}),l),n((()=>this.currentCoverageVisible),(e=>this._onCurrentCoverageVisibilityChange(e))),n((()=>this.isAdditionalCoverageVisible),(e=>this._onAdditionalCoverageVisibilityChange(e))),n((()=>this.isAdditionalPointSourcesVisible),(e=>this._onAdditionalCameraLocationsVisibility(e))),n((()=>({features:this.currentBestFeature,showCameraLocations:this.showCameraLocations,state:this.viewModel.state})),(({showCameraLocations:e,state:t})=>{"image-loaded"===t&&this.viewModel.overlayCameraLocations(e)}),c),n((()=>({feature:this.currentBestFeature,showMapFeatures:this.showMapFeatures,state:this.viewModel.state})),(async(e,t)=>{if(e.showMapFeatures!==t?.showMapFeatures&&this.viewModel.toggleAllOverlayMapFeatures(e.showMapFeatures),null!=e.feature&&e.feature!==t?.feature){if(this.viewModel.removeAllOverlayMapFeatures(),await d((()=>"image-loaded"===this.viewModel.state)),this.dataCaptureLayer&&this.stopDataCapture(),await this._restoreOverlays(),!this.dataCaptureLayer)return;await this.startDataCapture(this.dataCaptureLayer),this._previousAction?.active&&(this._previousAction.active=!1,this._previousAction=null)}}),l)])}loadDependencies(){return j({"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),shell:()=>import("@esri/calcite-components/dist/components/calcite-shell"),dialog:()=>import("@esri/calcite-components/dist/components/calcite-dialog"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),slider:()=>import("@esri/calcite-components/dist/components/calcite-slider"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}destroy(){this._galleryController.abort(),this._galleryObserver.disconnect()}get accuracyParametersMissing(){return this.viewModel.accuracyParametersMissing}get activeLayer(){return s(o.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer}set activeLayer(e){s(o.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer=e}get currentBestFeature(){return this.viewModel.currentBestFeature}set currentBestFeature(e){this.viewModel.currentBestFeature=e}get currentCoverageVisible(){return this.viewModel.currentCoverageVisible}set currentCoverageVisible(e){this.viewModel.currentCoverageVisible=e}get dataCaptureLayer(){return this.viewModel.dataCaptureLayer}set dataCaptureLayer(e){this.viewModel.dataCaptureLayer=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get displayMessage(){return this.viewModel.displayMessage}get features(){return this.viewModel.features}get imagePointsInView(){return this.viewModel.imagePointsInView}get icon(){return"oriented-imagery-widget"}set icon(e){this._overrideIfSome("icon",e)}get imageGalleryEnabled(){return this.viewModel.imageGalleryEnabled}get imageLocationToolActive(){return this.viewModel.imageLocationToolState}set imageLocationToolActive(e){this.viewModel.imageLocationToolState=e}get invalidCameraHeading(){return this.viewModel.invalidCameraHeading}get isAdditionalCoverageVisible(){return this.viewModel.isAdditionalCoverageVisible}set isAdditionalCoverageVisible(e){this.viewModel.isAdditionalCoverageVisible=e}get isAdditionalPointSourcesVisible(){return this.viewModel.isAdditionalPointSourcesVisible}set isAdditionalPointSourcesVisible(e){this.viewModel.isAdditionalPointSourcesVisible=e}get mapImageConversionToolState(){return this.viewModel.mapImageConversionToolState}set mapImageConversionToolState(e){this.viewModel.mapImageConversionToolState=e}get measureType(){return this.viewModel.measureType}set measureType(e){this.viewModel.measureType=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get popupEnabled(){const{popupEnabled:e,state:t}=this.viewModel;return"image-loaded"===t&&e}get referencePoint(){return this.viewModel.referencePoint??null}get sketchViewModel(){return this.viewModel.sketch}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}set determineWorkflowForFeature(e){this.viewModel.determineWorkflowForFeature=e}get determineWorkflowForFeature(){return this.viewModel.determineWorkflowForFeature}set updateFootprint(e){this.viewModel.updateFootprint=e}get updateFootprint(){return this.viewModel.updateFootprint}_renderActionBar(){return B("calcite-action-bar",{expandDisabled:!0,layout:"horizontal",slot:"action-bar"},B("calcite-action-group",null,this._currentFootprintToggle(),this._additionalFootprintToggle(),this._additionalPointSourcesToggle()),B("calcite-action-group",null,this._mapImageConversionToggle(),this._navigationToolToggle(),this._directionToolToggle(),this._imageEnhancementsToggle()),B("calcite-action-group",null,this._measurementToolsToggle(),this._imageGalleryToggle(),this._imageOverlaysToggle(),this._openPopupAction()))}get _activeMeasurementIcon(){const{measureType:e,imageLocationToolActive:t}=this;if(t)return"pin-tear";switch(e){case"area":return"measure-area";case"height":return"measure-building-height-top-base";default:return"measure-line"}}get _activeMeasurementHeading(){const{measureType:e,messages:t,viewModel:i}=this,{triangularMeasurementActive:a}=i,{groundArea:s,heightAboveGround:o,groundDistance:r,triangulatedAreaHeading:n,triangulatedDistanceHeading:l}=t;if(a)return"area"===e?n:l;switch(e){case"area":return s;case"height":return o;default:return r}}_additionalFootprintToggle(){const{isAdditionalCoverageVisible:e,invalidCameraHeading:t,visibleElements:{additionalFootprintToggle:i}}=this;return i?B("calcite-action",{active:e,bind:this,class:C.addCoverage,disabled:t,icon:"trapezoid-area",onclick:this._toggleAdditionalCoverage,text:this.messages.additionalFootprints,title:this.messages.additionalFootprints}):null}_additionalPointSourcesToggle(){const{isAdditionalPointSourcesVisible:e,invalidCameraHeading:t,visibleElements:{additionalCameraLocationsToggle:i}}=this;return i?B("calcite-action",{active:e,bind:this,class:C.addExpPoints,disabled:t,icon:"circle-area",onclick:this._toggleAdditionalCameraLocations,text:this.messages.additionalCameraLocations,title:this.messages.additionalCameraLocations}):null}get _measurementToggle(){const{viewModel:{state:e,measureType:t,triangularMeasurementActive:i,currentBestFeatureMeasurementImage:a},id:s}=this;if("image-loaded"!==e||!t||i&&!a)return;this._imageMeasurementToolsLoaderTask||this._loadImageMeasurementResources();const o=this._imageMeasurementToolsLoaderTask?.value;return o?B("calcite-dialog",{bind:this,dragEnabled:!0,escapeDisabled:!0,heading:this._activeMeasurementHeading,id:`${s}-${t}-measurement`,open:!0,placement:"bottom-start",resizable:!0,scale:"s",slot:"dialogs",width:"s",onCalciteDialogBeforeClose:this._clearMeasurements},B(o,{measurementType:t,measurementUnitMessages:this.measurementUnitMessages,messages:this.messages,oiViewModel:this.viewModel})):null}get _renderRoot(){const{viewModel:{state:e,triangularMeasurementActive:t}}=this;return B("calcite-panel",null,B("calcite-shell",null,B("calcite-panel",{bind:this,class:t?C.viewerContainerMeasurement:C.viewerContainer,heading:this.visibleElements.title?this.messages.title:void 0,loading:e.includes("loading")&&!t},this.visibleElements.menu?this._renderActionBar():null,this._imageViewer,this._panoramicViewer,this._messageBox,this.invalidCameraHeading?[this._renderWarning(this.messages.invalidCameraHeadingWarningTitle),this._renderWarningTooltip(this.messages.invalidCameraHeadingWarningDescription)]:[this._imageGalleryPanel,this._renderNavigation,this._imageOverlaysPanel()],this._imageEnhancementTools,this._renderNavigationUI,this._renderSketch()),this._imageViewerTriangular,this._measurementToggle,this._locationToggle))}_currentFootprintToggle(){const{currentCoverageVisible:e,invalidCameraHeading:t}=this,{currentFootprintToggle:i}=this.visibleElements;return i?B("calcite-action",{active:e,bind:this,class:C.currentCoverage,disabled:t,icon:"trapezoid-area",onclick:this._toggleCurrentCoverage,text:this.messages.currentFootprint,title:this.messages.currentFootprint}):null}get _imageEnhancementTools(){const{imageEnhancementToolActive:e,viewModel:{brightness:t,contrast:i,sharpness:a,state:s}}=this;return e&&"image-loaded"===s?B("calcite-panel",{bind:this,class:C.imageEnhancementWrapper,closable:!0,closed:!e,heading:this.messages.imageEnhancement,key:this.messages.imageEnhancement,onCalcitePanelClose:this._toggleImageEnhancementToolState},B("div",{class:C.imageEnhancementTools},B("div",{class:C.imageEnhancementToolContainer},B("calcite-label",null,this.messages.brightness,B("calcite-slider",{bind:this,labelTicks:!0,max:10,min:-10,ticks:5,value:t,onCalciteSliderInput:this._handleBrightnessChange}))),B("div",{class:C.imageEnhancementToolContainer},B("calcite-label",null,this.messages.contrast,B("calcite-slider",{bind:this,labelTicks:!0,max:10,min:-10,ticks:5,value:i,onCalciteSliderInput:this._handleContrastChange}))),B("div",{class:C.imageEnhancementToolContainer},B("calcite-label",null,this.messages.sharpness,B("calcite-slider",{bind:this,labelTicks:!0,max:1,min:0,step:.1,ticks:.5,value:a,onCalciteSliderInput:this._handleSharpnessChange})))),B("calcite-action",{bind:this,icon:"reset",onclick:this._resetImageTools,slot:"header-actions-end",text:this.messagesCommon.reset,title:this.messagesCommon.reset})):null}_imageEnhancementsToggle(){const{state:e,mode:t}=this.viewModel,{imageEnhancement:i}=this.visibleElements;return i?B("calcite-action",{active:this.imageEnhancementToolActive,bind:this,disabled:"default"!==t||"image-loaded"!==e,icon:"sliders-horizontal",onclick:this._toggleImageEnhancementToolState,text:this.messages.imageEnhancement,title:this.messages.imageEnhancement}):null}get _imageGalleryPanel(){const{container:e,galleryOpened:t,imageGalleryEnabled:i}=this;return i&&t&&e?this._imageGalleryContext:null}get _imageGalleryContext(){const{galleryOpened:e,invalidCameraHeading:t}=this;return B("calcite-panel",{bind:this,class:C.carousel,closable:!0,closed:!e,disabled:t,heading:this.messages.imageGallery,key:this.messages.imageGallery,onCalcitePanelClose:this._toggleImageGallery},B("div",{class:C.carouselContainer},this._renderThumbnails))}_imageGalleryToggle(){const{imageGalleryEnabled:e,invalidCameraHeading:t,visibleElements:{imageGallery:i}}=this;return i?B("calcite-action",{active:this.galleryOpened,bind:this,disabled:!e||t,icon:"images",onclick:this._toggleImageGallery,text:this.messages.imageGallery,title:this.messages.imageGallery}):null}get _imageOverlaysComponent(){const{_imageOverlayMessages:e,_imageOverlaysLoaderTask:t,_overlayedLayers:a,dataCaptureEnabled:s,dataCaptureLayer:o,imageOverlaysOpened:r,showCameraLocations:n,showMapFeatures:l,view:c,layer:d}=this;if(!d)return null;const g=d.imageGeometryField?.length?d.imageGeometryField:v,m=d.imageReferenceField?.length?d.imageReferenceField:y;t||(this._imageOverlaysLoaderTask=i((async()=>(await import("./OrientedImageryViewer/components/ImageOverlays.js")).default)));const h=this._imageOverlaysLoaderTask?.value;return h?B(h,{closed:!r,dataCaptureEnabled:s,dataCaptureLayer:o,imageGeometryField:g,imageReferenceField:m,messages:e,overlayedLayers:a,showCameraLocations:n,showMapFeatures:l,view:c,onDataCaptureLayerChanged:this._handleDataCaptureLayerChange,onImageOverlaysClosed:this._onImageOverlayClosed,onLayerDeselected:this._handleOverlayLayerDeselect,onLayerSelected:this._handleOverlayLayerSelect,onShowCameraLocationsChanged:this._onShowCameraLocationsChanged,onShowMapFeaturesChanged:this._onShowMapFeaturesChanged}):null}get _imageOverlayMessages(){return{...this.messages,...this.messagesSketch}}get _imageSketchToolsMessages(){return{...this.messagesSketch,...this.messagesCommon}}_imageOverlaysPanel(){const{imageOverlaysOpened:e,viewModel:{state:t}}=this,i=this.classes({[C.imageOverlaysContainer]:!0,[$.hidden]:!e||"image-loaded"!==t});return B("div",{class:i,key:this.messages.imageOverlays},this._imageOverlaysComponent)}_imageOverlaysToggle(){const{viewModel:{state:e},imageOverlaysOpened:t,invalidCameraHeading:i,visibleElements:{imageOverlays:a}}=this;return a?B("calcite-action",{active:t,bind:this,disabled:"image-loaded"!==e||i,icon:"layers",onclick:this._toggleImageOverlays,text:this.messages.imageOverlays,title:this.messages.imageOverlays}):null}get _imageViewer(){const{displayMessage:e,loadImageViewer:t,mode:i}=this.viewModel,a=null!=e||"default"!==i,s=this.classes({[C.viewer]:!a,[C.viewerHidden]:a});return B("calcite-panel",{afterCreate:t,bind:this,class:s},this._renderSketch())}get _imageViewerTriangular(){const{messages:e}=this,{displayMessage:t,storeImageMeasurementViewer:i,mode:a,state:s,triangularMeasurementActive:o}=this.viewModel,r=null!=t||"default"!==a,n=this.classes({[C.viewer]:!r,[C.viewerHidden]:r});return o?B("calcite-panel",{class:C.viewerContainerMeasurement,heading:e.measurementViewerHeading,loading:s.includes("loading")},B("calcite-panel",{bind:this,class:n},B(x,{afterCreate:i}))):null}get _locationToggle(){const{viewModel:{state:e,groundCoordinates:t,groundCoordinatesAccuracy:i},imageLocationToolActive:a,messages:{groundLocation:s}}=this;if("image-loaded"===e&&t&&a)return B("calcite-dialog",{bind:this,dragEnabled:!0,escapeDisabled:!0,heading:s,id:s,open:!0,placement:"bottom-start",resizable:!0,scale:"s",slot:"dialogs",width:"s",onCalciteDialogBeforeClose:this._clearImageLocation},B(P,{accuracy:i,groundCoordinates:t,messages:this.messages}))}_mapImageConversionToggle(){const{mapImageConversionToolState:e,viewModel:{state:t},invalidCameraHeading:i,visibleElements:{mapImageConversionTool:a}}=this;return a?B("calcite-action",{active:e,bind:this,disabled:"image-loaded"!==t||i,icon:"image-pin",onclick:this._toggleMapImageConversionToolState,text:this.messages.mapImageConversionTool,title:this.messages.mapImageConversionTool}):null}_measurementToolsToggle(){const{_activeMeasurementIcon:e,measureType:t,viewModel:i,accuracyParametersMissing:a,messages:s,visibleElements:{measurementTools:o}}=this,{state:r,triangularMeasurementActive:n,mode:l}=i,{measurementTools:c,groundDistance:d,groundArea:g,heightAboveGround:m,groundLocation:h,triangulatedDistanceHeading:u,triangulatedAreaHeading:p}=s;return o?B("calcite-dropdown",{disabled:a,key:"measurement-tools",maxItems:5,title:c,width:"m"},B("calcite-action",{bind:this,disabled:"image-loaded"!==r||a,icon:e,slot:"trigger",text:c}),B("calcite-dropdown-group",null,B("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"measure-line",key:"distance-measurement",onclick:e=>this._toggleMeasurementSketch(e,"distance"),selected:"distance"===t&&!n},d),B("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"measure-area",key:"area-measurement",onclick:e=>this._toggleMeasurementSketch(e,"area"),selected:"area"===t&&!n},g),B("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"measure-building-height-top-base",key:"height-dropdown",onclick:e=>this._toggleMeasurementSketch(e,"height"),selected:"height"===t},m),B("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"pin-tear",key:"surface-location",onclick:e=>this._toggleLocationTool(e),selected:this.imageLocationToolActive},h),"default"===l&&B(N,null,B("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"image-mensuration",key:"triangular-measurement-distance",selected:!!n&&"distance"===this.measureType,onCalciteDropdownItemSelect:this._toggleTriangularDistanceMeasurements},u),B("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"image-mensuration",key:"triangular-measurement-area",selected:!!n&&"area"===this.measureType,onCalciteDropdownItemSelect:this._toggleTriangularAreaMeasurements},p)))):null}get _messageBox(){const{messages:e,viewModel:{displayMessage:t}}=this;if(!t)return null;const{data:i,key:a,map:s}=t,o=`${s?U(e[a],s):e[a]}`;return B("span",{class:C.messageBox},i?`${o} ${i}`:o)}_navigationToolToggle(){const{state:e}=this.viewModel,{visibleElements:{navigationTool:t}}=this;return t?B("calcite-action",{active:this.navigationToolActive,bind:this,disabled:"image-loaded"!==e||this.invalidCameraHeading,icon:"explore",onclick:this._toggleNavigationTool,text:this.messages.navigationTool,title:this.messages.navigationTool}):null}_directionToolToggle(){const{state:e,mode:t}=this.viewModel,{visibleElements:{directions:i}}=this;return i?B("calcite-action",{active:this.directionToolsActive,bind:this,disabled:"image-loaded"!==e||this.invalidCameraHeading||"panoramic"!==t,icon:"tour",onclick:this._toggleDirectionsTool,text:this.messages.imageNavigation,title:this.messages.imageNavigation}):null}_openPopupAction(){const{showPopupsAction:e}=this.visibleElements;return e?B("calcite-action",{bind:this,disabled:!this.popupEnabled,icon:"popup",onclick:this._toggleImageAttributes,text:this.messages.showPopups,title:this.messages.showPopups}):null}get _panoramicViewer(){const{displayMessage:e,loadPanoramicViewer:t,mode:i}=this.viewModel,a=null!=e||"panoramic"!==i,s=this.classes({[C.viewer]:!a,[C.viewerHidden]:a});return B("calcite-panel",{afterCreate:t,bind:this,class:s})}get _renderNavigationUI(){const{visibleElements:{directions:e},directionToolsActive:t,viewModel:i}=this;return"image-loaded"===i.state&&e&&t&&"panoramic"===i.mode?B(G,{currentNode:this.viewModel.currentNode,navigate:this.viewModel.navigate,nodes:this.viewModel.navigationNodes}):null}_closeAllImageTools(){this.imageEnhancementToolActive=!1,this.navigationToolActive=!1,this.imageOverlaysOpened=!1,this.galleryOpened=!1,this.measureType=null,this.imageLocationToolActive=!1,this.directionToolsActive=!1}_handleBrightnessChange(e){this.viewModel.brightness=e.currentTarget.value??0}_handleContrastChange(e){this.viewModel.contrast=e.currentTarget.value??0}_handleSharpnessChange(e){this.viewModel.sharpness=e.currentTarget.value??0}_lazyLoadImage(e,t){e.forEach((async e=>{if(e.isIntersecting){const a=e.target,s=a.getAttribute("data-src"),n=a.getAttribute("data-rotation"),l=a.getAttribute("data-objectid"),c=n?parseFloat(n)%360:0,{layer:d,_galleryController:{signal:g}}=this;if(!s||!l)return;let m;try{m=k(s)?await O(d,l,{signal:g}):await S(s,{signal:g})}catch(i){r(i)||o.getLogger("esri.widgets.OrientedImageryViewer").error("#lazyLoadImage()",i)}finally{t.unobserve(a)}if(!m)return;F(m,a,c)}}))}_loadImageFromGallery(e){const{target:t}=e;if(!t)return;const i=t.getAttribute("data-objectid");i&&this.viewModel.currentBestFeature?.attributes.objectId!==Number(i)&&this.viewModel.selectBestFeature(i)}_loadImageMeasurementResources(){this._imageMeasurementToolsLoaderTask=i((async()=>{const{default:e}=await import("./OrientedImageryViewer/components/ImageMeasurementWidget.js");return e}))}_loadSketchResources(){this._sketchLoaderTask=i((async()=>(await import("./OrientedImageryViewer/components/SketchTools.js")).default))}_onAdditionalCoverageVisibilityChange(e){this.viewModel.setAdditionalCoverageVisibility(e)}_onAdditionalCameraLocationsVisibility(e){this.viewModel.setAdditionalCameraLocationsVisibility(e)}_onCurrentCoverageVisibilityChange(e){this.viewModel.setCurrentCoverageVisibility(e)}_registerGalleryItem(e){this._galleryObserver.observe(e)}_renderWarning(e){const{invalidCameraHeading:t,viewModel:{state:i}}=this;return t&&"image-loaded"===i?[B("calcite-notice",{class:C.alert,closable:!0,icon:"exclamation-mark-triangle-f",iconFlipRtl:!0,kind:"warning",open:!0,scale:"s"},B("div",{afterCreate:e=>this._storeWarningTitleElement(e),slot:"title"},e))]:null}_renderWarningTooltip(e){const{_warningTitleElement:t}=this;if(e?.length&&t)return B("calcite-tooltip",{closeOnClick:!0,referenceElement:t},e)}get _renderNavigation(){const{viewModel:{sectorData:e,navigatorCurrentBestFeature:i,currentBestFeature:a,state:s}}=this;if(!this.container||!a)return null;let o,r,n,l,c;if(i){const{x:e,y:t,direction:a}=i,[s,d,g,m]=w[a];o=`M ${e} ${t} L ${s} ${d} A ${_[2]} ${_[2]} 0 0 1 ${g} ${m} Z`,r=e,l=t,n=w[a][4],c=w[a][5]}const d=e=>{const t=e.target.dataset?.sector;t&&this.viewModel.handleSectorClick(+t)},g=e=>{const t=e.target.dataset;if(!t)return;const{featureIndexInSector:i,sector:a}=t;i&&a&&this.viewModel.handleFeatureClick({sector:a,featureIndexInSector:+i})},m=e=>{e.removeEventListener("click",g)},h=a.attributes.objectId,u=e?.map((e=>e?.items)).filter(Boolean).flatMap((e=>e?.map((({x:e,y:t,objectID:i,featureIndexInSector:a,sector:s})=>B("circle",{afterRemoved:m,class:this.classes(C.feature,{selected:h===i}),cx:e,cy:t,"data-feature-index-in-sector":a,"data-sector":s,key:`${C.feature}-${i}`,onclick:g,r:b}))))),v=e=>{e.removeEventListener("click",d)},y=this.classes({[C.navigationWrapper]:!0,[C.navigationZoomed]:this._navigationToolExpanded});return this.navigationToolActive&&"image-loaded"===s?B("div",{bind:this,class:y,key:this.messages.navigationTool},B("svg",{afterCreate:e=>this._storeNavigationToolReference(e),class:t()?I:C.rotateWithAnimation,focusable:"false",height:M,role:"img",width:M,xmlns:"http://www.w3.org/2000/svg"},B("defs",null,B("linearGradient",{gradientUnits:"userSpaceOnUse",id:`${this.id}-coverage-fill`,x1:r,x2:n,y1:l,y2:c},B("stop",{class:C.navigationPathOffset0,offset:0}),B("stop",{class:C.navigationPathOffset1,offset:1}))),B("g",null,B("circle",{class:this.classes(C.sector,C.outerSector),cx:_[3],cy:_[3],onclick:this._scaleNavigationTool,r:_[3]}),B("circle",{class:C.sector,cx:_[3],cy:_[3],r:_[2]}),B("circle",{class:C.sector,cx:_[3],cy:_[3],r:_[1]}),B("circle",{class:C.sector,cx:_[3],cy:_[3],r:_[0]}),B("path",{class:C.pointer,d:"M 56.5 6.06217782649107 L 60 0 L 63.5 6.06217782649107 Z",key:`${C.pointer}-west`}),B("path",{class:this.classes(C.pointer,C.north),d:"M 113.93782217350893 56.5 L 120 60 L 113.93782217350893 63.5 Z",key:`${C.pointer}-north`}),B("path",{class:C.pointer,d:"M 56.5 113.93782217350893 L 60 120 L 63.5 113.93782217350893 Z",key:`${C.pointer}-east`}),B("path",{class:C.pointer,d:"M 6.06217782649107 56.5 L 0 60 L 6.06217782649107 63.5 Z",key:`${C.pointer}-south`}),B("path",{class:this.classes(C.sector,C.sectorSeparator),d:"M 23.937554159486076 23.937554159486076 L 96.06244584051393 96.06244584051393 M 23.937554159486076 96.06244584051393 L 96.06244584051393 23.937554159486076",key:C.sectorSeparator}),p([_[2],_[1],_[0]],_[3],_[3]).map(((t,i)=>B("path",{afterRemoved:v,class:this.classes(C.sector,e?.[i]?.length?C.sectorEnabled:C.sectorDisabled),d:t,"data-sector":`${i}`,key:`${C.sector}-${i}`,onclick:d}))),B("path",{class:this.classes(C.sector,C.sectorCross),d:"M 56.4 56.4 L 63.53 63.53 M 63.53 56.4 L 56.4 63.53",key:C.sectorCross}),u,a.attributes.cameraPitch>=5&&o?B("path",{class:C.selectedFeaturePath,d:o,fill:`url(#${this.id}-coverage-fill)`,key:C.selectedFeaturePath}):null))):null}_renderSketch(){const{dataCaptureLayer:e,imageOverlaysOpened:t}=this;if(!e||t)return null;if(this._sketchLoaderTask||this._loadSketchResources(),!this._sketchLoaderTask?.value)return null;const{geometryType:i}=e,a="point"===i?"pin":"polyline"===i?"line":"polygon",s=this._sketchLoaderTask.value;return B("div",{class:C.sketchTools},B(s,{icon:a,messages:this._imageSketchToolsMessages,type:i,onAction:this._onAction}))}get _renderThumbnails(){const{currentBestFeature:e,thumbnails:t}=this.viewModel;return e?B("div",{class:C.carouselContent},t?.items.map((({url:t,objectId:i,rotation:a},s)=>B("div",{class:`${C.carouselItemWrapper}${e.attributes.objectId===i?"--selected":""}`,key:`${C.carouselItemWrapper}-${s}`},B("canvas",{afterCreate:this._registerGalleryItem,afterRemoved:this._unregisterGalleryItem,alt:`thumbnail-${i}`,class:C.carouselItem,"data-objectid":`${i}`,"data-rotation":`${a}`,"data-src":t,onclick:this._loadImageFromGallery,onmouseenter:this._highlight,onmouseleave:this._removeHighlight}))))):null}_resetImageTools(){this.viewModel.sharpness=this.viewModel.brightness=this.viewModel.contrast=0}_storeNavigationToolReference(e){this._navigationTool=e}_storeWarningTitleElement(e){this._warningTitleElement=e}_toggleAdditionalCameraLocations(){this.isAdditionalPointSourcesVisible=!this.isAdditionalPointSourcesVisible}_toggleAdditionalCoverage(){this.isAdditionalCoverageVisible=!this.isAdditionalCoverageVisible}_toggleCurrentCoverage(){this.currentCoverageVisible=!this.currentCoverageVisible}_toggleImageEnhancementToolState(e){e.stopPropagation();const t=this.imageEnhancementToolActive;this._closeAllImageTools(),this.imageEnhancementToolActive=!t}_toggleImageOverlays(e){e.stopPropagation();const t=this.imageOverlaysOpened;this._closeAllImageTools(),this.imageOverlaysOpened=!t}_toggleImageGallery(e){e.stopPropagation();const t=this.galleryOpened;this._closeAllImageTools(),this.galleryOpened=!!this.imageGalleryEnabled&&!t}_toggleLocationTool(e){const t=this.imageLocationToolActive;this._closeAllImageTools(),this.imageLocationToolActive=!t,e.stopPropagation()}_toggleMeasurementSketch(e,t){e.stopPropagation();const i=this.measureType;this._closeAllImageTools(),this.measureType=i===t?null:t,this.measureType===t&&(this.viewModel.displayNewMeasurementButton=!0)}_toggleNavigationTool(){const e=this.navigationToolActive;this._closeAllImageTools(),this.navigationToolActive=!e}_toggleMapImageConversionToolState(){this.mapImageConversionToolState=!this.mapImageConversionToolState}_toggleTriangularAreaMeasurements(){this._toggleTriangularMeasurements("area")}_toggleTriangularDistanceMeasurements(){this._toggleTriangularMeasurements("distance")}_toggleTriangularMeasurements(e){const t=this.viewModel.triangularMeasurementActive,i=this.viewModel.measureType,a=this.navigationToolActive;t?e===i?(this._closeAllImageTools(),this.viewModel.triangularMeasurementActive=!t,this.navigationToolActive=!a):(this.imageLocationToolActive=!1,this.measureType=e):(this._closeAllImageTools(),this.measureType=e,this.viewModel.triangularMeasurementActive=!t,this.navigationToolActive=!!a||!a)}_unregisterGalleryItem(e){this._galleryObserver.unobserve(e)}_updateNavigationTool(e){const{previousFeatureAngle:t,bestFeatureAngle:i}=this.viewModel,a=(i-t+540)%360-180;e.style.setProperty(f,`${t}deg`),e.style.setProperty(A,`${t+a}deg`)}async loadBestImage(e){return this.viewModel.loadBestImage(e)}loadImageFromSource(e,t){return this.viewModel.loadImageFromSource(e,t)}async overlayMapFeatures(e,t){return this.removeHandles(`${R.overlayed}-${e.id}`),this.addHandles(n((()=>e.visible),(()=>{this.viewModel.toggleOverlayMapFeatures(e.id,e.visible)})),`${R.overlayed}-${e.id}`),this._overlayedLayers.add(e),this.viewModel.overlayMapFeatures(e,t&&this.showMapFeatures)}async plotMapPoint(e){return this.viewModel.plotMapPoint(e)}plotReferencePointOnGround(e){this.viewModel.plotReferencePointOnGround(e)}plotReferencePointOnImage(e){this.viewModel.plotReferencePointOnImage(e)}removeOverlayedGraphicsOnImage(e){this.removeHandles(`${R.overlayed}-${e}`),this._overlayedLayers.remove(this._overlayedLayers.find((t=>t.id===e))),this.viewModel.removeOverlayedGraphicsOnImage(e)}resetImage(){this.viewModel.resetImage()}render(){return B("div",{class:this.classes($.widget,L)},this._renderRoot)}async startDataCapture(e){return this.viewModel.startDataCapture(e)}async stopDataCapture(e){return this.viewModel.stopDataCapture(e)}updateSuitabilities(e){this.viewModel.updateSuitabilities(e)}};e([g({readOnly:!0})],W.prototype,"accuracyParametersMissing",null),e([g()],W.prototype,"activeLayer",null),e([g()],W.prototype,"currentBestFeature",null),e([g()],W.prototype,"currentCoverageVisible",null),e([g()],W.prototype,"dataCaptureEnabled",void 0),e([g()],W.prototype,"dataCaptureLayer",null),e([g()],W.prototype,"disabled",null),e([g()],W.prototype,"features",null),e([g()],W.prototype,"imagePointsInView",null),e([g()],W.prototype,"galleryOpened",void 0),e([g()],W.prototype,"icon",null),e([g()],W.prototype,"imageEnhancementToolActive",void 0),e([g({readOnly:!0})],W.prototype,"imageGalleryEnabled",null),e([g()],W.prototype,"imageLocationToolActive",null),e([g()],W.prototype,"directionToolsActive",void 0),e([g()],W.prototype,"imageOverlaysOpened",void 0),e([g({readOnly:!0})],W.prototype,"invalidCameraHeading",null),e([g()],W.prototype,"isAdditionalCoverageVisible",null),e([g()],W.prototype,"isAdditionalPointSourcesVisible",null),e([g()],W.prototype,"mapImageConversionToolState",null),e([g()],W.prototype,"measureType",null),e([g()],W.prototype,"layer",null),e([g()],W.prototype,"navigationToolActive",void 0),e([H(T()),g({type:E})],W.prototype,"viewModel",void 0),e([g(),D("esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer")],W.prototype,"messages",void 0),e([g(),D("esri/core/t9n/Units")],W.prototype,"measurementUnitMessages",void 0),e([g(),D("esri/t9n/common")],W.prototype,"messagesCommon",void 0),e([g(),D("esri/widgets/Sketch/t9n/Sketch")],W.prototype,"messagesSketch",void 0),e([g()],W.prototype,"pixelMeasurementUnit",void 0),e([g()],W.prototype,"pixelAreaMeasurementUnit",void 0),e([g({readOnly:!0})],W.prototype,"popupEnabled",null),e([g()],W.prototype,"referencePoint",null),e([g()],W.prototype,"showCameraLocations",void 0),e([g()],W.prototype,"showMapFeatures",void 0),e([H(["create","delete","redo","undo","update"]),g({readOnly:!0})],W.prototype,"sketchViewModel",null),e([g()],W.prototype,"view",null),e([g({type:V,nonNullable:!0})],W.prototype,"visibleElements",void 0),e([g()],W.prototype,"determineWorkflowForFeature",null),e([g()],W.prototype,"updateFootprint",null),e([g()],W.prototype,"_activeMeasurementIcon",null),e([g()],W.prototype,"_activeMeasurementHeading",null),e([g()],W.prototype,"_imageOverlaysLoaderTask",void 0),e([g()],W.prototype,"_imageMeasurementToolsLoaderTask",void 0),e([g()],W.prototype,"_measurementToggle",null),e([g()],W.prototype,"_renderRoot",null),e([g()],W.prototype,"_imageEnhancementTools",null),e([g()],W.prototype,"_imageGalleryPanel",null),e([g()],W.prototype,"_imageGalleryContext",null),e([g()],W.prototype,"_imageOverlaysComponent",null),e([g()],W.prototype,"_imageOverlayMessages",null),e([g()],W.prototype,"_imageSketchToolsMessages",null),e([g()],W.prototype,"_imageViewer",null),e([g()],W.prototype,"_imageViewerTriangular",null),e([g()],W.prototype,"_locationToggle",null),e([g()],W.prototype,"_messageBox",null),e([g()],W.prototype,"_navigationToolExpanded",void 0),e([g()],W.prototype,"_navigationTool",void 0),e([g()],W.prototype,"_panoramicViewer",null),e([g()],W.prototype,"_renderNavigationUI",null),e([g()],W.prototype,"_warningTitleElement",void 0),e([g()],W.prototype,"_renderNavigation",null),e([g()],W.prototype,"_renderThumbnails",null),e([g()],W.prototype,"_sketchLoaderTask",void 0),W=e([m("esri.widgets.OrientedImageryViewer")],W);const z=W;export{z as default};
|
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{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:"i3d-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};
|
|
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/SelectionToolbar/VisibleElements.js";import S from"./support/SketchTooltipControls/VisibleElements.js";import{substitute as k}from"../intl/substitute.js";const P="esri-sketch",I={base:P,vertical:`${P}--vertical`,docked:`${P}-bar`,floating:`${P}-pad`,chipHorizontal:`${P}__selection-count-chip--horizontal`,chipVertical:`${P}__selection-count-chip--vertical`,chipVerticalSmall:`${P}__selection-count-chip--vertical--s`,popoverWrapper:`${P}__popover-wrapper`},R={point:"pin",polyline:"line",polygon:"polygon",rectangle:"rectangle",circle:"circle",multipoint:"pins",mesh:"i3d-building",freehandPolygon:"freehand-area",freehandPolyline:"freehand"};let E=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({visibleElements:new O({chip:!1,pan:!1,pointTool:!1}),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:{[I.base]:!0,[I.floating]:"floating"===e,[I.docked]:"docked"===e,[I.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:I.popoverWrapper},Object.values(l).includes(!0)?C(b,{sketchOptions:i.sketchOptions,viewType:o?.type,visibleElements:new S(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: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: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:{[I.chipVertical]:!0,[I.chipVerticalSmall]:"s"===this.scale},id:c,tabIndex:0,title:l},n):C("calcite-chip",{appearance:"outline",class:"horizontal"===e?I.chipHorizontal:I.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()],E.prototype,"_activeCustomToolOptions",void 0),e([p()],E.prototype,"activeTool",null),e([p({readOnly:!0})],E.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)))}})],E.prototype,"availableCreateTools",void 0),e([p({readOnly:!0})],E.prototype,"createGraphic",null),e([p()],E.prototype,"creationMode",null),e([p()],E.prototype,"customToolOptions",void 0),e([p()],E.prototype,"customActions",void 0),e([p()],E.prototype,"defaultCreateOptions",null),e([p()],E.prototype,"defaultUpdateOptions",null),e([p()],E.prototype,"icon",null),e([p()],E.prototype,"label",null),e([p()],E.prototype,"labelOptions",null),e([p()],E.prototype,"layer",null),e([p({type:["horizontal","vertical"],value:"horizontal"})],E.prototype,"layout",null),e([p({value:"m"})],E.prototype,"scale",null),e([p()],E.prototype,"toolbarKind",void 0),e([p()],E.prototype,"contextualToolLocation",void 0),e([p()],E.prototype,"groupCollapsePriorities",void 0),e([p(),T("esri/widgets/Sketch/t9n/Sketch")],E.prototype,"messages",void 0),e([p(),T("esri/t9n/common")],E.prototype,"messagesCommon",void 0),e([p()],E.prototype,"snappingOptions",null),e([p()],E.prototype,"state",null),e([p()],E.prototype,"tooltipOptions",null),e([p({readOnly:!0})],E.prototype,"updateGraphics",null),e([p({type:u,nonNullable:!0})],E.prototype,"valueOptions",null),e([p()],E.prototype,"view",null),e([p({type:v}),M(["create","update","undo","redo"])],E.prototype,"viewModel",null),e([p({type:m,nonNullable:!0})],E.prototype,"visibleElements",void 0),e([p()],E.prototype,"_effectiveAvailableCreateTools",null),e([p()],E.prototype,"_defaultViewModel",void 0),e([p()],E.prototype,"_calcitePopoverReferenceElement",void 0),e([p()],E.prototype,"_relativeLocation",void 0),e([p()],E.prototype,"_popoverOpen",void 0),E=e([d("esri.widgets.Sketch")],E);const j=E;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"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import o from"./FeatureItem.js";import s from"./ItemBase.js";let i=class extends s{constructor(e){super(e),this._onChangeController=null,this.layer=null,this.selection=[]}get effectiveObjectIds(){return this.objectIds.slice(0,this.maxVisibleFeatureCountPerLayer)}get maxVisibleFeatureCountExceeded(){return this.objectIds.length>this.viewModel.maxVisibleFeatureCountPerLayer}get maxVisibleFeatureCountPerLayer(){return this.viewModel.maxVisibleFeatureCountPerLayer}get objectIds(){return this.viewModel.
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import o from"./FeatureItem.js";import s from"./ItemBase.js";let i=class extends s{constructor(e){super(e),this._onChangeController=null,this.layer=null,this.selection=[]}get effectiveObjectIds(){return this.objectIds.slice(0,this.maxVisibleFeatureCountPerLayer)}get maxVisibleFeatureCountExceeded(){return this.objectIds.length>this.viewModel.maxVisibleFeatureCountPerLayer}get maxVisibleFeatureCountPerLayer(){return this.viewModel.maxVisibleFeatureCountPerLayer}get objectIds(){return this.viewModel.effectiveSelectionManager?.getSelection(this.layer)??[]}get total(){return this.objectIds.length}cancel(){this._onChangeController?.abort()}async sync({controller:e,promises:t}){this.cancel();const r=this.selection.slice(),o=new Map(r.map((e=>[e.objectId,e]))),s=this.effectiveObjectIds.slice(),i=[],a=[];for(const n of s){const e=o.get(n);e?(i.push(e),t.push(e.sync(t))):a.push(n)}if(this._onChangeController=e,a.length>0){const r=await this._createFeatureItems(a,e);for(const e of r)i.push(e),t.push(e.sync(t))}e.signal.aborted||(this.selection=i)}async _createFeatureItems(e,t){const{layer:r,layerView:s,viewModel:i}=this,a=new Map;if(s){const o=s.createQuery();o.objectIds=e,o.outFields=["*"],o.returnGeometry=!0;const i=await s.queryFeatures(o,t),{objectIdField:n}=r;for(const e of i?.features??[])a.set(e.attributes[n],e)}if(t.signal.aborted)return[];const n=e.filter((e=>!a.has(e)));if(n.length){const e=r.createQuery();e.objectIds=n,e.outSpatialReference=this.view?.spatialReference,e.outFields=["*"],e.returnGeometry=!0;const o=await r.queryFeatures(e,t);for(const t of o.features??[])a.set(t.attributes[r.objectIdField],t)}return Array.from(a.values()).map((e=>new o({layer:r,graphic:e,viewModel:i})))}};e([t()],i.prototype,"_onChangeController",void 0),e([t()],i.prototype,"effectiveObjectIds",null),e([t()],i.prototype,"layer",void 0),e([t()],i.prototype,"maxVisibleFeatureCountExceeded",null),e([t()],i.prototype,"maxVisibleFeatureCountPerLayer",null),e([t()],i.prototype,"objectIds",null),e([t()],i.prototype,"selection",void 0),e([t()],i.prototype,"total",null),i=e([r("esri.widgets.support.SelectionList.LayerItem")],i);const a=i;export{a 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 t from"../../../core/Accessor.js";import o from"../../../core/Logger.js";import{removeMaybe as r}from"../../../core/maybe.js";import{ignoreAbortErrors as i,debounce as s}from"../../../core/promiseUtils.js";import{watch as
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import o from"../../../core/Logger.js";import{removeMaybe as r}from"../../../core/maybe.js";import{ignoreAbortErrors as i,debounce as s}from"../../../core/promiseUtils.js";import{watch as l,on as n}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as h}from"../../../core/support/UpdatingHandles.js";import{isSubtypeGroupLayer as p,isSubtypeSublayer as g}from"../../../layers/support/layerUtils.js";import{isSelectableLayer as u}from"../../../views/support/selectionUtils.js";import{goTo as m}from"../goToUtils.js";import y from"./GroupLayerItem.js";import f from"./LayerItem.js";import{computeEffectiveCount as d,getNestedLayerItems as v,isLayerItem as S,isGroupLayerItem as C,getNestedFeatureItems as I}from"./selectionListUtils.js";const b=100;let _=class extends t{constructor(e){super(e),this._groupItemCache=new Map,this._hoverHighlightHandle=null,this._layerItemCache=new Map,this._allLayerItems=null,this._onChangeAbortController=null,this._updatingHandles=new h,this.featureTitleMap=new Map,this.layer=null,this.maxVisibleFeatureCountPerLayer=500,this.selectionManager=null,this._onSelectionChangeController=async()=>{this._cancelOnSelectionChange();const e=new AbortController;this._onChangeAbortController=e,await this._updatingHandles.addPromise(i(this._onSelectionChange(e))),this._onChangeAbortController===e&&(this._onChangeAbortController=null);const t=this.layer&&this.effectiveSelectionManager?.getSelection(this.layer);t?.length||(this.layer=null)},this._cancelOnSelectionChange=()=>this._onChangeAbortController?.abort(),this._onSelectionChangeDebounced=s(this._onSelectionChangeController,b)}initialize(){this.addHandles([l((()=>[this.view,this.effectiveSelectionManager]),(()=>this._onSelectionChangeDebounced())),n((()=>this.effectiveSelectionManager?.sources),"change",(()=>this._onSelectionChangeDebounced())),n((()=>this.effectiveSelectionManager),"selection-change",(()=>this._onSelectionChangeDebounced()))])}destroy(){this.removeTemporaryHighlight(),this._updatingHandles.destroy()}get allLayerItems(){return this._allLayerItems??[]}get effectiveCount(){return d(this.allLayerItems)}get effectiveSelectionManager(){return this.selectionManager??this.view?.selectionManager}get isUpdating(){return!(!this._onChangeAbortController&&!this._updatingHandles.updating)}get layerItems(){return v(this.allLayerItems)}get layerViewMap(){const e=new Map,{view:t}=this;if(!t)return e;for(const o of t.allLayerViews)if(e.set(o.layer.id,o),p(o.layer))for(const t of o.layer.sublayers)e.set(t.id,o);return e}get maxVisibleFeatureCountExceeded(){return this.allLayerItems.some((e=>e.maxVisibleFeatureCountExceeded))}get selectionSources(){const e=this.effectiveSelectionManager,t=new Set;if(e?.sources)for(const o of e.sources)t.add(o);return t}get state(){const{view:e}=this;return e?e.ready?this.effectiveSelectionManager?"ready":"error":"loading":"disabled"}get totalCount(){return this.effectiveSelectionManager?.count??0}get viewLayersAndTables(){const{view:e}=this;return e?.map?[...e.map.layers.toArray().reverse(),...e.map.tables.toArray().reverse()]:[]}get visibleFeatureCount(){let e=0;for(const t of this.layerItems)e+=t.maxVisibleFeatureCountExceeded?t.maxVisibleFeatureCountPerLayer:t.total;return e}addTemporaryHighlight({graphic:e,layerView:t}){this.removeTemporaryHighlight(),t&&e&&(this._hoverHighlightHandle=t.highlight(e,{name:"temporary"}))}clear(){this.effectiveSelectionManager?.clear()}deselectFeatureItem(e){const t=e.graphic.getObjectId();null!=t&&this.effectiveSelectionManager?.removeFromSelection(e.layer,[t])}deselectGroupItem(e){e.children.forEach((e=>{S(e)?this.deselectLayerItem(e):this.deselectGroupItem(e)}))}deselectLayerItem(e){this.effectiveSelectionManager?.setSelection(e.layer,[])}deselectItem(e){C(e)?this.deselectGroupItem(e):S(e)?this.deselectLayerItem(e):this.deselectFeatureItem(e)}goToItem(e){S(e)||C(e)?this._goTo(I([e]).map((e=>e.graphic))):this._goTo(e.graphic)}layersToItems(e){const{controller:t,layers:o,promises:r}=e,{_groupItemCache:i,_layerItemCache:s,effectiveSelectionManager:l,viewLayersAndTables:n}=this,a=o??n;if(!l)return[];const c=[];for(const h of a)switch(h.type){case"subtype-group":case"group":{const e=i.get(h),o=e??new y({layer:h,viewModel:this});e||i.set(h,o),r.push(o.sync({controller:t,promises:r})),c.push(o)}break;default:if(u(h)||g(h)){const e=h,o=l.getSelection(e);if(!o?.length)continue;const i=s.get(e),n=i??new f({layer:e,viewModel:this});i||s.set(e,n),r.push(n.sync({controller:t,promises:r})),c.push(n)}}return c}removeFromSelection(e){this.effectiveSelectionManager?.removeFromSelection(e.layer,e.objectIds)}removeTemporaryHighlight(){this._hoverHighlightHandle=r(this._hoverHighlightHandle)}selectSingleFeatureItem(e){const t=e.objectId;if(null!=t&&this.effectiveSelectionManager)for(const{layer:o}of this.effectiveSelectionManager.selections)this.setSelection({layer:o,objectIds:o===e.layer?[t]:[]})}selectSingleGroupItem(e){if(this.effectiveSelectionManager)for(const{layer:t,selection:o}of this.effectiveSelectionManager.selections)this.setSelection({layer:t,objectIds:t.parent===e.layer?o:[]})}selectSingleItem(e){C(e)?this.selectSingleGroupItem(e):S(e)?this.selectSingleLayerItem(e):this.selectSingleFeatureItem(e)}selectSingleLayerItem(e){if(this.effectiveSelectionManager)for(const{layer:t,selection:o}of this.effectiveSelectionManager.selections)this.setSelection({layer:t,objectIds:t===e.layer?o:[]})}setSelection(e){this.effectiveSelectionManager?.setSelection(e.layer,e.objectIds)}async _goTo(e){const{view:t}=this;if(t)try{await m(t,e)}catch(r){"AbortError"!==r.name&&o.getLogger(this).warn("Failed to go to feature(s)",r)}}async _onSelectionChange(e){try{this.removeTemporaryHighlight();const t=[],o=this.layersToItems({controller:e,promises:t});t.length>0&&await Promise.all(t),this._onChangeAbortController===e&&(this._allLayerItems=o)}catch(t){o.getLogger(this).warn("Failed updating selection",t)}}};e([a()],_.prototype,"_groupItemCache",void 0),e([a()],_.prototype,"_hoverHighlightHandle",void 0),e([a()],_.prototype,"_layerItemCache",void 0),e([a()],_.prototype,"_allLayerItems",void 0),e([a()],_.prototype,"_onChangeAbortController",void 0),e([a()],_.prototype,"allLayerItems",null),e([a()],_.prototype,"effectiveCount",null),e([a()],_.prototype,"effectiveSelectionManager",null),e([a()],_.prototype,"featureTitleMap",void 0),e([a()],_.prototype,"isUpdating",null),e([a()],_.prototype,"layer",void 0),e([a()],_.prototype,"layerItems",null),e([a()],_.prototype,"layerViewMap",null),e([a()],_.prototype,"maxVisibleFeatureCountExceeded",null),e([a()],_.prototype,"maxVisibleFeatureCountPerLayer",void 0),e([a()],_.prototype,"selectionManager",void 0),e([a()],_.prototype,"selectionSources",null),e([a()],_.prototype,"state",null),e([a()],_.prototype,"totalCount",null),e([a()],_.prototype,"view",void 0),e([a()],_.prototype,"viewLayersAndTables",null),e([a()],_.prototype,"visibleFeatureCount",null),_=e([c("esri.widgets.support.SelectionList.SelectionListViewModel")],_);const M=_;export{M 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 o}from"../../../chunks/tslib.es6.js";import e from"../../../core/Accessor.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as
|
|
5
|
+
import{_ as o}from"../../../chunks/tslib.es6.js";import e from"../../../core/Accessor.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";let i=class extends e{constructor(o){super(o),this.countText=!1,this.filter=!0,this.filterNotice=!0,this.itemCloseActions=!0,this.itemCountChip=!0,this.itemIcons=!0,this.itemMenus=!0,this.header=!0,this.layerFilter=!0,this.menu=!0,this.totalCountChip=!0}};o([t({type:Boolean,nonNullable:!0})],i.prototype,"countText",void 0),o([t({type:Boolean,nonNullable:!0})],i.prototype,"filter",void 0),o([t({type:Boolean,nonNullable:!0})],i.prototype,"filterNotice",void 0),o([t({type:Boolean,nonNullable:!0})],i.prototype,"itemCloseActions",void 0),o([t({type:Boolean,nonNullable:!0})],i.prototype,"itemCountChip",void 0),o([t({type:Boolean,nonNullable:!0})],i.prototype,"itemIcons",void 0),o([t({type:Boolean,nonNullable:!0})],i.prototype,"itemMenus",void 0),o([t({type:Boolean,nonNullable:!0})],i.prototype,"header",void 0),o([t({type:Boolean,nonNullable:!0})],i.prototype,"layerFilter",void 0),o([t({type:Boolean,nonNullable:!0})],i.prototype,"menu",void 0),o([t({type:Boolean,nonNullable:!0})],i.prototype,"totalCountChip",void 0),i=o([l("esri.widgets.support.SelectionList.VisibleElements")],i);const r=i;export{r as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.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{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import o from"../Widget.js";import{loadCalciteComponents as l}from"./componentsUtils.js";import{globalCss as n}from"./globalCss.js";import{storeNode as r}from"./widgetUtils.js";import{messageBundle as a}from"./decorators/messageBundle.js";import{tsx as c}from"./jsxFactory.js";import{isGroupLayerItem as m,isLayerItem as d,isFeatureItem as p}from"./SelectionList/selectionListUtils.js";import h from"./SelectionList/SelectionListViewModel.js";import u from"./SelectionList/VisibleElements.js";import{formatNumber as g}from"../../intl/number.js";import{substitute as v}from"../../intl/substitute.js";const y="esri-selection-list",I=`${y}__list-item`,f={base:y,baseSmall:`${y}--small`,baseMedium:`${y}--medium`,baseLarge:`${y}--large`,container:`${y}__container`,notice:`${y}__notice`,listItemFeature:`${I}__feature`,listItemFeatureIcon:`${I}__feature-icon`,listItemIcon:`${I}__icon`,totalCountChip:`${y}__total-count`};let b=class extends o{constructor(e,t){super(e,t),this._list=null,this._iconIntersectionObserver=new IntersectionObserver(((e,t)=>{e.forEach((async e=>{if(e.isIntersecting){const i=e.target;if(this._hasIcon(i))return void t.unobserve(i);const s=this._getListItem(i);if(!s)return;this._setHasIcon(i,!0);const o=await s.fetchThumbnail().catch((()=>(this._setHasIcon(i,!1),null)));if(null==o)return;i.appendChild(o)}}))})),this.displayMode="group",this.menuScale="m",this.messages=null,this.messagesCommon=null,this.scale="s",this.viewModel=new h,this.visibleElements=new u,this._afterItemCreate=e=>{this._iconIntersectionObserver?.observe(e)},this._afterItemRemoved=e=>{this._iconIntersectionObserver?.unobserve(e)},this.clear=this.clear.bind(this),this.collapseItems=this.collapseItems.bind(this),this.removeTemporaryHighlight=this.removeTemporaryHighlight.bind(this)}destroy(){this._iconIntersectionObserver?.disconnect(),this._iconIntersectionObserver=null}loadDependencies(){return l({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel")})}get effectiveCount(){return this.viewModel.effectiveCount}get effectiveSelectionManager(){return this.viewModel.effectiveSelectionManager}get featureTitleMap(){return this.viewModel.featureTitleMap}get icon(){return"selection"}set icon(e){this._overrideIfSome("icon",e)}get isUpdating(){return this.viewModel.isUpdating}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layerItems(){return this.viewModel.layerItems}get layerViewMap(){return this.viewModel.layerViewMap}get maxVisibleFeatureCountExceeded(){return this.viewModel.maxVisibleFeatureCountExceeded}get maxVisibleFeatureCountPerLayer(){return this.viewModel.maxVisibleFeatureCountPerLayer}set maxVisibleFeatureCountPerLayer(e){this.viewModel.maxVisibleFeatureCountPerLayer=e}get selectionManager(){return this.viewModel.selectionManager}set selectionManager(e){this.viewModel.selectionManager=e}get selectionSources(){return this.viewModel.selectionSources}get selectionsByLayerMap(){return this.viewModel.selectionsByLayerMap}get state(){return this.viewModel.state}get totalCount(){return this.viewModel.totalCount}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get viewLayersAndTables(){return this.viewModel.viewLayersAndTables}addTemporaryHighlight(e){this.viewModel.addTemporaryHighlight(e)}clear(){this.viewModel.clear()}deselectFeatureItem(e){this.viewModel.deselectFeatureItem(e)}deselectGroupItem(e){this.viewModel.deselectGroupItem(e)}deselectLayerItem(e){this.viewModel.deselectLayerItem(e)}deselectItem(e){this.viewModel.deselectItem(e)}collapseItems(){this._list?.filteredItems.forEach((e=>e.expanded=!1))}goToItem(e){this.viewModel.goToItem(e)}removeFromSelection(e){this.viewModel.removeFromSelection(e)}removeTemporaryHighlight(){this.viewModel.removeTemporaryHighlight()}selectSingleFeatureItem(e){this.viewModel.selectSingleFeatureItem(e)}selectSingleGroupItem(e){this.viewModel.selectSingleGroupItem(e)}selectSingleItem(e){this.viewModel.selectSingleItem(e)}selectSingleLayerItem(e){this.viewModel.selectSingleLayerItem(e)}setSelection(e){this.viewModel.setSelection(e)}render(){return c("div",{class:this.classes(f.base,n.widget,n.panel,this._getBaseCssClass())},c("calcite-flow",null,c("calcite-flow-item",{class:f.container,heading:this.visibleElements.header?this.messages.selection:void 0,loading:"loading"===this.state,scale:this.scale,selected:!0},c("calcite-panel",{overlayPositioning:"fixed",scale:this.scale},this._renderList()),this._renderTotalChip(),this._renderMenuActions())))}_renderTotalChip(){const{visibleElements:e}=this;if(!e.totalCountChip||!e.header)return;const{effectiveCount:t}=this,i=g(t),s=v(this.messages.selectionCount,{count:i});return c("calcite-chip",{appearance:"outline",class:f.totalCountChip,closable:t>0,closed:0===t,icon:this.maxVisibleFeatureCountExceeded?"exclamation-mark-triangle":void 0,label:i,scale:this.scale,slot:"header-actions-end",title:s,onCalciteChipClose:this.clear},i)}_renderMenuActions(){const{visibleElements:e}=this;if(!e.header||!e.menu)return;const{menuScale:t}=this,i=0===this.totalCount;return[c("calcite-action",{disabled:i,icon:"reset",onclick:this.clear,scale:t,slot:"header-menu-actions",text:this.messagesCommon.clear,textEnabled:!0}),c("calcite-action",{disabled:i,icon:"folders",onclick:this.collapseItems,scale:t,slot:"header-menu-actions",text:this.messages.collapseAll,textEnabled:!0})]}_renderList(){const e=this.layerItems??[],t=!!(this.visibleElements.filter&&this.effectiveCount>0);return c("calcite-list",{afterCreate:r,bind:this,"data-node-ref":"_list",displayMode:"nested",filterEnabled:t,filterPlaceholder:this.messages.filter,filterPredicate:({value:e})=>null==this._list?.filterText||new RegExp(this._list.filterText,"iu").test(e),interactionMode:"interactive",label:this.messages.widgetLabel,loading:this.isUpdating,scale:this.scale,selectionMode:"none"},this._renderListContent(e))}_renderListContent(e){return e.map((e=>m(e)?this._renderGroupItem(e):d(e)?this._renderLayerItem(e):null)).filter(t)}_renderItemCountChip(e){if(!this.visibleElements.itemCountChip)return;const{messages:t}=this,{maxVisibleFeatureCountExceeded:i,total:s}=e,o=g(s),l=i?t.tooManyFeatures:v(t.selectionCount,{count:o});return c("calcite-chip",{appearance:"outline",icon:i?"exclamation-mark-triangle":void 0,label:o,scale:"s",slot:"content-end",title:l},o)}_renderItemActions(e){if(!this.visibleElements.itemMenus)return;const{messages:t,messagesCommon:i}=this,s=p(e),o=s?t.deselectFeature:d(e)?t.deselectLayer:t.deselectGroup;return[c("calcite-dropdown",{overlayPositioning:"fixed",scale:this.menuScale,slot:"actions-end",width:"m"},c("calcite-action",{appearance:"transparent",icon:"ellipsis",scale:this.scale,slot:"trigger",text:i.menu,textEnabled:!1}),c("calcite-dropdown-group",{selectionMode:"none"},c("calcite-dropdown-item",{iconStart:"layer-zoom-to",onCalciteDropdownItemSelect:()=>this.goToItem(e)},t.zoomTo),c("calcite-dropdown-item",{iconStart:"selection-filter",onCalciteDropdownItemSelect:()=>this.selectSingleItem(e)},s?t.onlySelectFeature:t.onlySelectThis),c("calcite-dropdown-item",{iconStart:"selection-x",onCalciteDropdownItemSelect:()=>this.deselectItem(e)},o)))]}_renderGroupItem(e){const t=e.title||this.messages.untitledLayer;if(0===e.total)return;const{displayMode:i}=this;if("layer"===i||"feature"===i)return this._renderListContent(e.children);const{visibleElements:s}=this;return c("calcite-list-item",{bind:this,closable:!!s.itemCloseActions,expanded:!0,iconStart:s.itemIcons?e.iconName:void 0,key:e.key,label:t,onclick:t=>{t.stopPropagation(),this.emit("item-click",{item:e})},title:t,value:e.title,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)}},this._renderItemCountChip(e),this._renderItemActions(e),this._renderListContent(e.children))}_renderLayerItem(e){const{messages:t}=this,i=e.title||t.untitledLayer;if(0===e.total)return;if("feature"===this.displayMode)return this._renderItems(e.selection);const{visibleElements:s}=this;return c("calcite-list-item",{bind:this,closable:!!s.itemCloseActions,expanded:!0,iconStart:s.itemIcons?e.iconName:void 0,key:e.key,label:i,onclick:t=>{t.stopPropagation(),this.emit("item-click",{item:e})},scale:this.scale,title:i,value:e.title,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)}},this._renderItemCountChip(e),this._renderItemActions(e),this._renderItems(e.selection),e.maxVisibleFeatureCountExceeded?c("calcite-notice",{class:f.notice,icon:"exclamation-mark-triangle",kind:"info",open:!0,scale:this.scale},c("div",{slot:"message"},t.tooManyFeatures)):void 0)}_renderItems(e){return e.map((e=>this._renderItem(e)))}_renderItem(e){const{messages:t,visibleElements:i}=this,s=e.title||t.untitledFeature,o=i.itemIcons&&"feature"!==this.displayMode;return c("calcite-list-item",{bind:this,class:o?f.listItemFeatureIcon:f.listItemFeature,closable:!!i.itemCloseActions,"data-item":e,key:e.key,label:s,name:s,onblur:this.removeTemporaryHighlight,onclick:t=>{t.stopPropagation(),this.emit("item-click",{item:e})},onfocus:()=>this.addTemporaryHighlight(e),onpointerenter:()=>this.addTemporaryHighlight(e),onpointerleave:this.removeTemporaryHighlight,scale:this.scale,title:s,value:s,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)}},this._renderItemIcon(e),this._renderItemActions(e))}_renderItemIcon(e){if(this.visibleElements.itemIcons)return c("div",{class:f.listItemIcon,key:"content-start",slot:"content-start"},c("span",{afterCreate:this._afterItemCreate,afterRemoved:this._afterItemRemoved,"data-has-icon":!1,"data-item":e,key:"icon"}))}_getListItem(e){return e?.["data-item"]}_hasIcon(e){return!!e?.["data-has-icon"]}_setHasIcon(e,t){e&&(e["data-has-icon"]=t)}_getBaseCssClass(){switch(this.scale){case"s":return f.baseSmall;case"m":return f.baseMedium;default:return f.baseLarge}}};e([i()],b.prototype,"_list",void 0),e([i()],b.prototype,"displayMode",void 0),e([i()],b.prototype,"effectiveCount",null),e([i()],b.prototype,"effectiveSelectionManager",null),e([i()],b.prototype,"featureTitleMap",null),e([i()],b.prototype,"icon",null),e([i()],b.prototype,"isUpdating",null),e([i()],b.prototype,"label",null),e([i()],b.prototype,"layerItems",null),e([i()],b.prototype,"layerViewMap",null),e([i()],b.prototype,"maxVisibleFeatureCountExceeded",null),e([i()],b.prototype,"maxVisibleFeatureCountPerLayer",null),e([i()],b.prototype,"menuScale",void 0),e([i(),a("esri/widgets/support/SelectionList/t9n/SelectionList")],b.prototype,"messages",void 0),e([i(),a("esri/t9n/common")],b.prototype,"messagesCommon",void 0),e([i()],b.prototype,"scale",void 0),e([i()],b.prototype,"selectionManager",null),e([i()],b.prototype,"selectionSources",null),e([i()],b.prototype,"selectionsByLayerMap",null),e([i()],b.prototype,"state",null),e([i()],b.prototype,"totalCount",null),e([i()],b.prototype,"view",null),e([i()],b.prototype,"viewLayersAndTables",null),e([i()],b.prototype,"viewModel",void 0),e([i({type:u,nonNullable:!0})],b.prototype,"visibleElements",void 0),b=e([s("esri.widgets.support.SelectionList")],b);const w=b;export{w as default};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import{isSome as t}from"../../core/arrayUtils.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import o from"../Widget.js";import{loadCalciteComponents as l}from"./componentsUtils.js";import{globalCss as r}from"./globalCss.js";import{storeNode as n}from"./widgetUtils.js";import{messageBundle as a}from"./decorators/messageBundle.js";import{tsx as c}from"./jsxFactory.js";import{isGroupLayerItem as m,isLayerItem as d,isFeatureItem as h}from"./SelectionList/selectionListUtils.js";import p from"./SelectionList/SelectionListViewModel.js";import u from"./SelectionList/VisibleElements.js";import{formatNumber as y}from"../../intl/number.js";import{substitute as g}from"../../intl/substitute.js";const v="esri-selection-list",I=`${v}__list-item`,f={base:v,container:`${v}__container`,notice:`${v}__notice`,countText:`${v}__count-text`,layerDropdown:`${v}__layer-dropdown`,listItemFeature:`${I}__feature`,listItemFeatureIcon:`${I}__feature-icon`,listItemIcon:`${I}__icon`,totalCountChip:`${v}__total-count`};let b=class extends o{constructor(e,t){super(e,t),this._list=null,this._iconIntersectionObserver=new IntersectionObserver(((e,t)=>{e.forEach((async e=>{if(e.isIntersecting){const i=e.target;if(this._hasIcon(i))return void t.unobserve(i);const s=this._getListItem(i);if(!s)return;this._setHasIcon(i,!0);const o=await s.fetchThumbnail().catch((()=>(this._setHasIcon(i,!1),null)));if(null==o)return;i.appendChild(o)}}))})),this.displayMode="group",this.menuScale="m",this.messages=null,this.messagesCommon=null,this.scale="s",this.viewModel=new p,this.visibleElements=new u,this._afterItemCreate=e=>{this._iconIntersectionObserver?.observe(e)},this._afterItemRemoved=e=>{this._iconIntersectionObserver?.unobserve(e)},this.clear=this.clear.bind(this),this.collapseItems=this.collapseItems.bind(this),this.removeTemporaryHighlight=this.removeTemporaryHighlight.bind(this)}destroy(){this._iconIntersectionObserver?.disconnect(),this._iconIntersectionObserver=null}loadDependencies(){return l({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel")})}get _activeLayerItem(){return this.layer&&this.layerItems.find((e=>e.layer===this.layer))}get allLayerItems(){return this.viewModel.allLayerItems}get effectiveCount(){return this.viewModel.effectiveCount}get effectiveSelectionManager(){return this.viewModel.effectiveSelectionManager}get featureTitleMap(){return this.viewModel.featureTitleMap}get icon(){return"selection"}set icon(e){this._overrideIfSome("icon",e)}get isUpdating(){return this.viewModel.isUpdating}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get layerItems(){return this.viewModel.layerItems}get layerViewMap(){return this.viewModel.layerViewMap}get maxVisibleFeatureCountExceeded(){return this.viewModel.maxVisibleFeatureCountExceeded}get maxVisibleFeatureCountPerLayer(){return this.viewModel.maxVisibleFeatureCountPerLayer}set maxVisibleFeatureCountPerLayer(e){this.viewModel.maxVisibleFeatureCountPerLayer=e}get selectionManager(){return this.viewModel.selectionManager}set selectionManager(e){this.viewModel.selectionManager=e}get selectionSources(){return this.viewModel.selectionSources}get state(){return this.viewModel.state}get totalCount(){return this.viewModel.totalCount}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get viewLayersAndTables(){return this.viewModel.viewLayersAndTables}get visibleFeatureCount(){return this.viewModel.visibleFeatureCount}addTemporaryHighlight(e){this.viewModel.addTemporaryHighlight(e)}clear(){this.viewModel.clear()}deselectFeatureItem(e){this.viewModel.deselectFeatureItem(e)}deselectGroupItem(e){this.viewModel.deselectGroupItem(e)}deselectLayerItem(e){this.viewModel.deselectLayerItem(e)}deselectItem(e){this.viewModel.deselectItem(e)}collapseItems(){this._list?.filteredItems.forEach((e=>e.expanded=!1))}goToItem(e){this.viewModel.goToItem(e)}removeFromSelection(e){this.viewModel.removeFromSelection(e)}removeTemporaryHighlight(){this.viewModel.removeTemporaryHighlight()}selectSingleFeatureItem(e){this.viewModel.selectSingleFeatureItem(e)}selectSingleGroupItem(e){this.viewModel.selectSingleGroupItem(e)}selectSingleItem(e){this.viewModel.selectSingleItem(e)}selectSingleLayerItem(e){this.viewModel.selectSingleLayerItem(e)}setSelection(e){this.viewModel.setSelection(e)}render(){return c("div",{class:this.classes(f.base,r.widget,r.panel)},c("calcite-flow",null,c("calcite-flow-item",{class:f.container,heading:this.visibleElements.header?this.messages.selection:void 0,loading:"loading"===this.state,overlayPositioning:"fixed",scale:this.scale,selected:!0},c("calcite-panel",{overlayPositioning:"fixed",scale:this.scale},this._renderLayerFilter(),this._renderCountText(),this._renderList()),this._renderTotalChip(),this._renderMenuActions())))}_renderTotalChip(){const{visibleElements:e}=this;if(!e.totalCountChip||!e.header)return;const{effectiveCount:t}=this,i=y(t),s=g(this.messages.selectionCount,{count:i});return c("calcite-chip",{appearance:"outline",class:f.totalCountChip,closable:t>0,closed:0===t,icon:this.maxVisibleFeatureCountExceeded?"exclamation-mark-triangle":void 0,label:i,scale:this.scale,slot:"header-actions-end",title:s,onCalciteChipClose:this.clear},i)}_renderMenuActions(){const{visibleElements:e}=this;if(!e.header||!e.menu)return;const{menuScale:t}=this,i=0===this.totalCount;return[c("calcite-action",{disabled:i,icon:"reset",key:"clear-action",onclick:this.clear,scale:t,slot:"header-menu-actions",text:this.messagesCommon.clear,textEnabled:!0}),c("calcite-action",{disabled:i,icon:"folders",key:"collapse-action",onclick:this.collapseItems,scale:t,slot:"header-menu-actions",text:this.messages.collapseAll,textEnabled:!0})]}_renderCountText(){if(!this.visibleElements.countText)return;const{effectiveCount:e,messages:t,visibleFeatureCount:i}=this,s=y(e);return c("div",{class:f.countText,key:"feature-count-label"},this.maxVisibleFeatureCountExceeded?g(t.featuresCountShowing,{count:s,visibleCount:y(i)}):g(t.featuresCount,{count:s}))}_renderLayerFilter(){const{layerItems:e,messages:t}=this;if(0!==this.totalCount&&0!==e.length&&this.visibleElements.layerFilter)return c("calcite-combobox",{class:f.layerDropdown,clearDisabled:!0,label:t.filterByLayer,overlayPositioning:"fixed",placeholder:t.filterByLayer,scale:this.scale,selectionMode:"single-persist",onCalciteComboboxChange:({currentTarget:e})=>{this._list&&(this._list.filterText=""),this.layer=e.selectedItems[0]?.value??void 0}},c("calcite-combobox-item",{heading:g(t.allLayersCount,{count:e.length}),icon:"layers",key:"all-layers",selected:null==this.layer,value:null}),this.layerItems.map((e=>this._renderLayerFilterItem(e))))}_renderLayerFilterItem(e){const t=e.title||this.messages.untitledLayer;return c("calcite-combobox-item",{heading:t,icon:e.iconName,key:e.key,selected:e.layer===this.layer,value:e.layer})}_renderList(){const{messages:e}=this,t=!!(this.visibleElements.filter&&this.effectiveCount>0);return c("calcite-list",{afterCreate:n,bind:this,"data-node-ref":"_list",displayMode:"nested",filterEnabled:t,filterPlaceholder:e.filter,filterPredicate:({value:e})=>null==this._list?.filterText||new RegExp(this._list.filterText,"iu").test(e),interactionMode:"interactive",label:e.widgetLabel,loading:this.isUpdating,scale:this.scale,selectionMode:"none"},this._renderListContent(this.allLayerItems),this._renderFilterNotice())}_renderListContent(e){return this._activeLayerItem?this._renderLayerItem(this._activeLayerItem):e.map((e=>m(e)?this._renderGroupItem(e):d(e)?this._renderLayerItem(e):null)).filter(t)}_renderFilterNotice(){const{visibleElements:e}=this;if(e.filter&&e.filterNotice)return c("calcite-notice",{icon:"exclamation-mark-triangle",kind:"info",open:!0,scale:this.scale,slot:"filter-no-results"},c("div",{slot:"message"},this.messages.noMatchingFeatures))}_renderItemCountChip(e){if(!this.visibleElements.itemCountChip)return;const{messages:t}=this,{maxVisibleFeatureCountExceeded:i,total:s}=e,o=y(s),l=i?t.tooManyFeatures:g(t.selectionCount,{count:o});return c("calcite-chip",{appearance:"outline",icon:i?"exclamation-mark-triangle":void 0,label:o,scale:"s",slot:"content-end",title:l},o)}_renderItemActions(e){if(!this.visibleElements.itemMenus)return;const{messages:t,messagesCommon:i}=this,s=h(e),o=s?t.deselectFeature:d(e)?t.deselectLayer:t.deselectGroup;return[c("calcite-dropdown",{overlayPositioning:"fixed",scale:this.menuScale,slot:"actions-end",width:"m"},c("calcite-action",{appearance:"transparent",icon:"ellipsis",scale:this.scale,slot:"trigger",text:i.menu,textEnabled:!1}),c("calcite-dropdown-group",{selectionMode:"none"},c("calcite-dropdown-item",{iconStart:"layer-zoom-to",onCalciteDropdownItemSelect:()=>this.goToItem(e)},t.zoomTo),c("calcite-dropdown-item",{iconStart:"selection-filter",onCalciteDropdownItemSelect:()=>this.selectSingleItem(e)},s?t.onlySelectFeature:t.onlySelectThis),c("calcite-dropdown-item",{iconStart:"selection-x",onCalciteDropdownItemSelect:()=>this.deselectItem(e)},o)))]}_renderGroupItem(e){const t=e.title||this.messages.untitledLayer;if(0===e.total)return;const{displayMode:i}=this;if("layer"===i||"feature"===i)return this._renderListContent(e.children);const{visibleElements:s}=this;return c("calcite-list-item",{bind:this,closable:!!s.itemCloseActions,expanded:!0,iconStart:s.itemIcons?e.iconName:void 0,key:e.key,label:t,onclick:t=>{t.stopPropagation(),this.emit("item-click",{item:e})},value:e.title,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)}},this._renderItemActions(e),this._renderListContent(e.children))}_renderLayerItem(e){const{messages:t}=this,i=e.title||t.untitledLayer;if(0===e.total)return;if("feature"===this.displayMode||this._activeLayerItem)return this._renderItems(e.selection);const{visibleElements:s}=this;return c("calcite-list-item",{bind:this,closable:!!s.itemCloseActions,expanded:!0,iconStart:s.itemIcons?e.iconName:void 0,key:e.key,label:i,onclick:t=>{t.stopPropagation(),this.emit("item-click",{item:e})},scale:this.scale,value:e.title,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)}},this._renderItemCountChip(e),this._renderItemActions(e),this._renderItems(e.selection),e.maxVisibleFeatureCountExceeded?c("calcite-notice",{class:f.notice,icon:"exclamation-mark-triangle",kind:"info",open:!0,scale:this.scale},c("div",{slot:"message"},t.tooManyFeatures)):void 0)}_renderItems(e){return e.map((e=>this._renderItem(e)))}_renderItem(e){const{messages:t,visibleElements:i}=this,s=e.title||t.untitledFeature,o=i.itemIcons&&"feature"!==this.displayMode;return c("calcite-list-item",{bind:this,class:o?f.listItemFeatureIcon:f.listItemFeature,closable:!!i.itemCloseActions,"data-item":e,key:e.key,label:s,name:s,onblur:this.removeTemporaryHighlight,onclick:t=>{t.stopPropagation(),this.emit("item-click",{item:e})},onfocus:()=>this.addTemporaryHighlight(e),onpointerenter:()=>this.addTemporaryHighlight(e),onpointerleave:this.removeTemporaryHighlight,scale:this.scale,value:s,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)}},this._renderItemIcon(e),this._renderItemActions(e))}_renderItemIcon(e){if(this.visibleElements.itemIcons)return c("div",{class:f.listItemIcon,key:"content-start",slot:"content-start"},c("span",{afterCreate:this._afterItemCreate,afterRemoved:this._afterItemRemoved,"data-has-icon":!1,"data-item":e,key:"icon"}))}_getListItem(e){return e?.["data-item"]}_hasIcon(e){return!!e?.["data-has-icon"]}_setHasIcon(e,t){e&&(e["data-has-icon"]=t)}};e([i()],b.prototype,"_activeLayerItem",null),e([i()],b.prototype,"_list",void 0),e([i()],b.prototype,"allLayerItems",null),e([i()],b.prototype,"displayMode",void 0),e([i()],b.prototype,"effectiveCount",null),e([i()],b.prototype,"effectiveSelectionManager",null),e([i()],b.prototype,"featureTitleMap",null),e([i()],b.prototype,"icon",null),e([i()],b.prototype,"isUpdating",null),e([i()],b.prototype,"label",null),e([i()],b.prototype,"layer",null),e([i()],b.prototype,"layerItems",null),e([i()],b.prototype,"layerViewMap",null),e([i()],b.prototype,"maxVisibleFeatureCountExceeded",null),e([i()],b.prototype,"maxVisibleFeatureCountPerLayer",null),e([i()],b.prototype,"menuScale",void 0),e([i(),a("esri/widgets/support/SelectionList/t9n/SelectionList")],b.prototype,"messages",void 0),e([i(),a("esri/t9n/common")],b.prototype,"messagesCommon",void 0),e([i()],b.prototype,"scale",void 0),e([i()],b.prototype,"selectionManager",null),e([i()],b.prototype,"selectionSources",null),e([i()],b.prototype,"state",null),e([i()],b.prototype,"totalCount",null),e([i()],b.prototype,"view",null),e([i()],b.prototype,"viewLayersAndTables",null),e([i()],b.prototype,"viewModel",void 0),e([i()],b.prototype,"visibleFeatureCount",null),e([i({type:u,nonNullable:!0})],b.prototype,"visibleElements",void 0),b=e([s("esri.widgets.support.SelectionList")],b);const _=b;export{_ 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{deprecatedProperty as t}from"../../../core/deprecate.js";import o from"../../../core/Evented.js";import{handlesGroup as
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import{deprecatedProperty as t}from"../../../core/deprecate.js";import o from"../../../core/Evented.js";import{handlesGroup as r}from"../../../core/handleUtils.js";import s from"../../../core/Logger.js";import{removeMaybe as i}from"../../../core/maybe.js";import{watch as a}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{isKnowledgeGraphLayer as l,isLinkChartLayer as p}from"../../../layers/support/layerUtils.js";import{findLayerView as u}from"../../../views/draw/support/layerUtils.js";import{isSelectableLayerView2D as h}from"../../../views/support/layerViewUtils.js";import d from"../Selector2D/SelectionOperation.js";let f=class extends o.EventedAccessor{constructor(e){super(e),this._operationHandlesGroup=null,this.activeOperation=null,this.layerViewPreferenceEnabled=!0,this.selectionManager=null,this.sources=null}initialize(){this.addHandles([a((()=>this.effectiveSources),(e=>{this.activeOperation&&(this.activeOperation.sources=e)}))])}destroy(){this._operationHandlesGroup=i(this._operationHandlesGroup)}get effectiveSelectionManager(){return this.selectionManager??this.view?.selectionManager}get effectiveSources(){const{layerViewPreferenceEnabled:e,sources:t,view:o}=this,r=t??this.effectiveSelectionManager?.sources;if(!r?.length)return[];const s=[];return r.forEach((t=>{if(h(t))s.push(t);else if(l(t)||p(t)){(t.layers||[]).forEach((t=>{const r=o?u(o,t):void 0,i=e&&h(r)?r:t;s.push(i)}))}else if(e){const e=o?u(o,t):void 0,r=h(e)?e:t;s.push(r)}else s.push(t)})),s}get layers(){return t(s.getLogger(this),"layers",{replacement:"Use SelectionToolbar.sources instead."}),this.sources}set layers(e){t(s.getLogger(this),"layers",{replacement:"Use SelectionToolbar.sources instead."}),this.sources=e}get state(){return this.activeOperation?"active":this.view?.ready&&this.effectiveSources.length?"ready":"disabled"}cancel(){"active"===this.state&&(this.activeOperation?.cancel(),this._set("activeOperation",null))}activate(e){const{effectiveSources:t,effectiveSelectionManager:o,state:s,view:i}=this;if("disabled"===s||!t?.length||!i)return;"active"===s&&this.cancel();const a=new d({selectionManager:o,sources:t,options:e,view:i});return this._operationHandlesGroup=r([a.selection.on("change",(e=>this.emit("selection-change",e))),a.once("complete",(e=>this._onOperationComplete(e)))]),this._set("activeOperation",a),a}_onOperationComplete(e){this._operationHandlesGroup=i(this._operationHandlesGroup),this._set("activeOperation",null),this.emit("complete",e)}};e([n({readOnly:!0})],f.prototype,"activeOperation",void 0),e([n()],f.prototype,"effectiveSelectionManager",null),e([n()],f.prototype,"effectiveSources",null),e([n()],f.prototype,"layers",null),e([n()],f.prototype,"layerViewPreferenceEnabled",void 0),e([n()],f.prototype,"selectionManager",void 0),e([n()],f.prototype,"sources",void 0),e([n({readOnly:!0})],f.prototype,"state",null),e([n()],f.prototype,"view",void 0),f=e([c("esri.widgets.support.SelectionToolbar.SelectionToolbarViewModel")],f);const v=f;export{v as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{_ as o}from"../../../chunks/tslib.es6.js";import e from"../../../core/Accessor.js";import{property as t}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";let r=class extends e{constructor(o){super(o),this.chip=!0,this.lassoTool=!0,this.pan=!0,this.pointTool=!0,this.rectangleTool=!0}};o([t({type:Boolean,nonNullable:!0})],r.prototype,"chip",void 0),o([t({type:Boolean,nonNullable:!0})],r.prototype,"lassoTool",void 0),o([t({type:Boolean,nonNullable:!0})],r.prototype,"pan",void 0),o([t({type:Boolean,nonNullable:!0})],r.prototype,"pointTool",void 0),o([t({type:Boolean,nonNullable:!0})],r.prototype,"rectangleTool",void 0),r=o([s("esri.widgets.support.SelectionToolbar.VisibleElements")],r);const l=r;export{l 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{deprecatedProperty as
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import{deprecatedProperty as t}from"../../core/deprecate.js";import{handlesGroup as o}from"../../core/handleUtils.js";import i from"../../core/Logger.js";import{removeMaybe as s}from"../../core/maybe.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import n from"../Widget.js";import{loadCalciteComponents as a}from"./componentsUtils.js";import{globalCss as c}from"./globalCss.js";import"./widgetUtils.js";import{messageBundle as p}from"./decorators/messageBundle.js";import{tsx as d}from"./jsxFactory.js";import h from"./SelectionToolbar/SelectionToolbarViewModel.js";import u from"./SelectionToolbar/VisibleElements.js";import{formatNumber as f}from"../../intl/number.js";const v="esri-selection-toolbar",m={base:v,container:`${v}__container`,toolButton:`${v}__tool-button`};let g=class extends n{constructor(e,t){super(e,t),this._viewModelHandlesGroup=null,this.activeToolInfo=null,this.defaultLassoToolOptions={createTool:"polygon",mode:"freehand"},this.defaultPointToolOptions={createTool:"point"},this.defaultRectangleToolOptions={createTool:"rectangle"},this.disabled=!1,this.layout="horizontal",this.messages=null,this.scale="s",this.toolConfigs=[],this.viewModel=new h,this.visibleElements=new u,this._viewModelHandlesGroup=o([this.viewModel.on("complete",(e=>{this._set("activeToolInfo",null),this.emit("complete",e)}))])}destroy(){this._viewModelHandlesGroup=s(this._viewModelHandlesGroup)}loadDependencies(){return a({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip")})}get _effectiveDisabled(){return this.disabled||"disabled"===this.state}get activeOperation(){return this.viewModel.activeOperation}get effectiveSelectionManager(){return this.viewModel.effectiveSelectionManager}get effectiveSources(){return this.viewModel.effectiveSources}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layers(){return t(i.getLogger(this),"layers",{replacement:"Use SelectionToolbar.sources instead."}),this.viewModel.sources}set layers(e){t(i.getLogger(this),"layers",{replacement:"Use SelectionToolbar.sources instead."}),this.viewModel.sources=e}get layerViewPreferenceEnabled(){return this.viewModel.layerViewPreferenceEnabled}set layerViewPreferenceEnabled(e){this.viewModel.layerViewPreferenceEnabled=e}get selectionManager(){return this.viewModel.selectionManager}set selectionManager(e){this.viewModel.selectionManager=e}get state(){return this.viewModel.state}get sources(){return this.viewModel.sources}set sources(e){this.viewModel.sources=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visibleToolCount(){const{view:e,toolConfigs:t,visibleElements:o}=this;return(t?.length??0)+("2d"===e?.type?(o.lassoTool?1:0)+(o.rectangleTool?1:0):0)}activate(e){if(this.cancel(),!this._effectiveDisabled)switch(e){case"lasso":this._activateTool("lasso");break;case"rectangle":this._activateTool("rectangle");break;default:this._activateTool(e)}}cancel(){this.viewModel.cancel(),this._set("activeToolInfo",null)}render(){return d("div",{"aria-label":this.label,class:this.classes(m.base,c.widget)},d("div",{class:m.container},this._renderDefaultTools(),this._renderCustomTools()))}_renderDefaultTools(){if("2d"===this.view?.type)return[this._renderPanAction(),this._renderPointTool(),this._renderRectangleTool(),this._renderLassoTool(),this._renderChip()]}_renderPanAction(){if(!this.visibleElements.pan)return;const e=this.messages.pan,t=`${this.id}-tool-pan`;return this._renderAction({active:!this.activeToolInfo,disabled:this._effectiveDisabled,icon:"pan",id:t,key:t,onclick:()=>this.cancel(),text:e,title:e})}_renderChip(){if(!this.visibleElements.chip)return;const{effectiveSelectionManager:e}=this,t=e?.count??0,o=f(t);return d("calcite-chip",{appearance:"outline",closable:t>0,closed:0===t,disabled:this._effectiveDisabled||0===t,label:o,scale:this.scale,title:this.messages.clearSelection,onCalciteChipClose:()=>e?.clear()},o)}_renderCustomTools(){if(this.toolConfigs?.length)return this.toolConfigs.map((({toolName:e,icon:t,toolKey:o})=>this._renderToolWithTooltip(e,o,t)))}_renderPointTool(){if(this.visibleElements.pointTool)return this._renderToolWithTooltip("point","point","selection-set",this.messages.selectByPoint)}_renderLassoTool(){if(this.visibleElements.lassoTool)return this._renderToolWithTooltip("lasso","lasso","lasso-select",this.messages.selectByLasso)}_renderRectangleTool(){if(this.visibleElements.rectangleTool)return this._renderToolWithTooltip("rectangle","rectangle","cursor-marquee",this.messages.selectByRectangle)}_renderToolWithTooltip(e,t,o,i=e){const s=`${this.id}-tool-${t}`;return this._renderAction({active:this.activeToolInfo?.toolName===e,disabled:this._effectiveDisabled,icon:o||"selection",id:s,key:s,onclick:()=>this._toggleTool(e),text:i,title:i})}_renderAction(e){return d("calcite-action",{...e,bind:this,class:m.toolButton,scale:this.scale})}_activateTool(e){const t=this._getToolOptions(e);if(!t)return;const o=this.viewModel.activate(t);o&&this._set("activeToolInfo",{toolName:e,operation:o})}_toggleTool(e){if(this.activeToolInfo){const t=this.activeToolInfo.toolName;if(this.cancel(),t===e)return}this._activateTool(e)}_getToolOptions(e){return"lasso"===e?this.defaultLassoToolOptions:"point"===e?this.defaultPointToolOptions:"rectangle"===e?this.defaultRectangleToolOptions:this.toolConfigs.find((t=>t.toolName===e))}};e([l()],g.prototype,"_effectiveDisabled",null),e([l()],g.prototype,"activeOperation",null),e([l({readOnly:!0})],g.prototype,"activeToolInfo",void 0),e([l()],g.prototype,"defaultLassoToolOptions",void 0),e([l()],g.prototype,"defaultPointToolOptions",void 0),e([l()],g.prototype,"defaultRectangleToolOptions",void 0),e([l()],g.prototype,"disabled",void 0),e([l()],g.prototype,"effectiveSelectionManager",null),e([l()],g.prototype,"effectiveSources",null),e([l()],g.prototype,"label",null),e([l()],g.prototype,"layers",null),e([l()],g.prototype,"layerViewPreferenceEnabled",null),e([l()],g.prototype,"layout",void 0),e([l(),p("esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar")],g.prototype,"messages",void 0),e([l()],g.prototype,"scale",void 0),e([l()],g.prototype,"selectionManager",null),e([l()],g.prototype,"state",null),e([l()],g.prototype,"sources",null),e([l()],g.prototype,"toolConfigs",void 0),e([l()],g.prototype,"view",null),e([l()],g.prototype,"viewModel",void 0),e([l({type:u,nonNullable:!0})],g.prototype,"visibleElements",void 0),e([l()],g.prototype,"visibleToolCount",null),g=e([r("esri.widgets.support.SelectionToolbar")],g);const T=g;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{_ as e}from"../../../chunks/tslib.es6.js";import{createTask as o}from"../../../core/asyncUtils.js";import t from"../../../core/Collection.js";import s from"../../../core/Evented.js";import{makeHandle as r}from"../../../core/handleUtils.js";import{debounce as i,ignoreAbortErrors as n,onAbort as c}from"../../../core/promiseUtils.js";import{createScreenPoint as l}from"../../../core/screenUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import d from"../../../geometry/Point.js";import m from"../../../geometry/Polygon.js";import{isClockwise as h}from"../../../geometry/support/coordsUtils.js";import{DrawScreenTool as
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import{createTask as o}from"../../../core/asyncUtils.js";import t from"../../../core/Collection.js";import s from"../../../core/Evented.js";import{makeHandle as r}from"../../../core/handleUtils.js";import{debounce as i,ignoreAbortErrors as n,onAbort as c}from"../../../core/promiseUtils.js";import{createScreenPoint as l}from"../../../core/screenUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import d from"../../../geometry/Point.js";import m from"../../../geometry/Polygon.js";import{isClockwise as h}from"../../../geometry/support/coordsUtils.js";import{DrawScreenTool as g}from"../../../views/draw/DrawScreenTool.js";import{sketchKeys as u}from"../../../views/interactive/keybindings.js";import{getSelectionFromGeometry as y}from"./selectorUtils.js";const v=100;let f=class extends s.EventedAccessor{constructor(e){super(e),this._processTask=null,this.options=null,this.selection=new t,this.selectionManager=null,this.sources=null,this._process=i((async(e,t)=>{const{callback:s,selector:r,completed:i}=e,n=o((async e=>{const{effectiveSelectionManager:o,options:t,selection:n,sources:c,view:l}=this,a=!c?.length&&!o.sources.length;if(n.removeAll(),!a&&l){if(r&&null!=c){const s=await y({returnGeometry:t?.returnGeometry,selector:r,signal:e,sources:c,view:l});n.addMany(s),i&&!1!==t?.persistSelection&&o.updateSelection({current:s,added:[],removed:[]})}s&&s()}}));return c(t,(()=>n.abort())),this._processTask=n,n.promise}),v)}initialize(){this._setup()}get effectiveSelectionManager(){return this.selectionManager??this.view.selectionManager}get processingFinalSelection(){return!(!this._processTask||!this._tool?.drawOperation.isCompleted)}cancel(){this.removeAllHandles(),this._processTask?.abort()}async _setup(){const{view:e}=this;if(await e.whenReady(),this.destroyed)return;const o=this.options,t=o?.createTool??"rectangle",s=o?.mode??("polygon"===t?"click":"hybrid"),i=Symbol();this._tool=new g({view:e,mode:s,geometryType:t}),o?.selectOnComplete||this.addHandles(this._tool.on(["cursor-update","vertex-add","vertex-remove"],(()=>n(this._process({selector:this._selectionArea})))),i),this.addHandles([e.on("key-down",(e=>{if(!e.repeat)switch(e.key){case u.constraint:this._tool.uniformSizeToggled=!0,e.stopPropagation();break;case u.center:this._tool.centeredToggled=!0,e.stopPropagation()}})),e.on("key-up",(e=>{switch(e.key){case u.constraint:this._tool.uniformSizeToggled=!1,e.stopPropagation();break;case u.center:this._tool.centeredToggled=!1,e.stopPropagation()}})),this._tool.on("complete",(async e=>{this.removeHandles(i);const o=()=>{this.removeAllHandles(),this.emit("complete",{aborted:e.aborted,selection:this.selection.toArray()})};e.aborted?(this.cancel(),this.selection.removeAll(),o()):(this._tool.cursor="progress",await this._process({selector:this._selectionArea,callback:o,completed:!0}))}))],i),this.addHandles(r((()=>e.tools.remove(this._tool)))),e.addAndActivateTool(this._tool)}get _selectionArea(){const e=l(),o=this._tool.coordinates,t=this.view.spatialReference,s=o=>{e.x=o[0],e.y=o[1];const t=this.view.toMap(e);return[t?.x??0,t?.y??0]};if(0===o.length)return;if(1===o.length||o.every((([e,t])=>e===o[0][0]&&t===o[0][1]))){const[e,r]=s(o[0]);return new d({x:e,y:r,spatialReference:t})}const r=o.map(s);if(0===r.length)return;h(r)||r.reverse();return new m({spatialReference:t,rings:[r]})}};e([a()],f.prototype,"_processTask",void 0),e([a()],f.prototype,"effectiveSelectionManager",null),e([a()],f.prototype,"options",void 0),e([a()],f.prototype,"processingFinalSelection",null),e([a({readOnly:!0})],f.prototype,"selection",void 0),e([a()],f.prototype,"selectionManager",void 0),e([a()],f.prototype,"sources",void 0),e([a({constructOnly:!0})],f.prototype,"view",void 0),f=e([p("esri.widgets.support.Selector2D.SelectionOperation")],f);const _=f;export{_ as default};
|