@arcgis/core 4.33.0-next.20250620 → 4.33.1

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.
@@ -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 i}from"../../../core/accessorSupport/decorators/subclass.js";import o from"../../../views/MapView.js";import r from"../../Widget.js";import a from"./ImageViewerViewModel.js";import n from"./NavigationUI.js";import{loadSequentialNavigationUIComponents as s,SequentialNavigationUI as l}from"./SequentialNavigationUI.js";import{loadCalciteComponents as d}from"../../support/componentsUtils.js";import{globalCss as p}from"../../support/globalCss.js";import"../../support/widgetUtils.js";import{vmEvent as c}from"../../support/decorators/vmEvent.js";import{tsx as g}from"../../support/jsxFactory.js";const h="esri-image-viewer";let u=class extends r{constructor(){super(...arguments),this.navigationEnabled=!1,this.uiStrings=null,this.viewModel=new a,this._afterContainerCreate=e=>{this.imageRenderer.container=e},this.addGraphic=(e,t)=>{this.viewModel.addGraphic(e,t)},this.addManyGraphics=e=>{this.viewModel.addManyGraphics(e)},this.clearGraphics=()=>{this.viewModel.clearGraphics()},this.clearImage=()=>{this.viewModel.clearImage()},this.loadImage=async e=>this.viewModel.loadImage(e),this.navigate=async(e,t)=>this.viewModel.navigate(e,t),this.removeGraphic=e=>{this.viewModel.removeGraphic(e)},this.removeManyGraphics=e=>{this.viewModel.removeManyGraphics(e)}}loadDependencies(){return Promise.all([d({panel:()=>import("@esri/calcite-components/dist/components/calcite-panel")}),s()])}get autoLoad(){return this.viewModel.autoLoad}set autoLoad(e){this.viewModel.autoLoad=e}get brightness(){return this.viewModel.brightness}set brightness(e){this.viewModel.brightness=e}get clickAction(){return this.viewModel.clickAction}set clickAction(e){this.viewModel.clickAction=e}get contrast(){return this.viewModel.contrast}set contrast(e){this.viewModel.contrast=e}get currentNode(){return this.navigationViewModel?.currentNode}get customParameters(){return this.viewModel.customParameters}set customParameters(e){this.viewModel.customParameters=e}get error(){return this.viewModel.error}get imageSize(){const e=this.viewModel.image?.serviceRasterInfo;return e?[e.width,e.height]:[0,0]}get imagePointsInView(){return this.viewModel.imagePointsInView}get imageRenderer(){return this.viewModel.imageRenderer}get imageRotation(){return this.viewModel.imageRotation}set imageRotation(e){this.viewModel.imageRotation=e}get imageSource(){return this.viewModel.imageSource}set imageSource(e){this.viewModel.imageSource=e}get navigationNodes(){return this.navigationViewModel?.navigationNodes}get navigationMode(){return this.navigationViewModel?.navigationMode}get navigationViewModel(){return this.viewModel.navigationViewModel}set navigationViewModel(e){this.viewModel.navigationViewModel=e}get sharpness(){return this.viewModel.sharpness}set sharpness(e){this.viewModel.sharpness=e}get state(){return this.viewModel.state}get ui(){return this.imageRenderer.ui}get _navigationUI(){return g(n,{cameraHeadingThreshold:this.navigationViewModel?.cameraHeadingThreshold,cameraPitchThreshold:this.navigationViewModel?.cameraPitchThreshold,currentNode:this.currentNode,navigate:this.navigate,nodes:this.navigationNodes,preserveAngle:this.navigationViewModel?.preserveAngle??"none"})}get _sequentialNavigationUI(){return g(l,{layout:"horizontal",uiStrings:this.uiStrings,onAction:e=>{this.navigate(this.currentNode,e)}})}_renderNavigationUI(){switch(this.navigationMode){case"directional":return this._navigationUI;case"sequential":return this._sequentialNavigationUI;default:return null}}render(){return g("calcite-panel",{afterCreate:this._afterContainerCreate,bind:this,class:this.classes(p.widget,h)},this.navigationEnabled?this._renderNavigationUI():null)}static{this.vnodeSelector="calcite-panel"}};e([t({type:Boolean})],u.prototype,"autoLoad",null),e([t({type:Number}),t()],u.prototype,"brightness",null),e([t()],u.prototype,"clickAction",null),e([t({type:Number})],u.prototype,"contrast",null),e([t()],u.prototype,"currentNode",null),e([t({type:Object})],u.prototype,"customParameters",null),e([t({readOnly:!0})],u.prototype,"error",null),e([t()],u.prototype,"imageSize",null),e([t({readOnly:!0})],u.prototype,"imagePointsInView",null),e([t({readOnly:!0,type:o})],u.prototype,"imageRenderer",null),e([t()],u.prototype,"imageRotation",null),e([t()],u.prototype,"imageSource",null),e([t({type:Boolean})],u.prototype,"navigationEnabled",void 0),e([t()],u.prototype,"navigationNodes",null),e([t()],u.prototype,"navigationMode",null),e([t()],u.prototype,"navigationViewModel",null),e([t({type:Number})],u.prototype,"sharpness",null),e([t({readOnly:!0})],u.prototype,"state",null),e([t()],u.prototype,"ui",null),e([t()],u.prototype,"uiStrings",void 0),e([c(["click","hittest-response","pixel-location"]),t({type:a})],u.prototype,"viewModel",void 0),e([t()],u.prototype,"_navigationUI",null),e([t()],u.prototype,"_sequentialNavigationUI",null),u=e([i("esri.widgets.OrientedImageryViewer.components.ImageViewer")],u);const m=u;export{m as default};
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 i}from"../../../core/accessorSupport/decorators/subclass.js";import o from"../../../views/MapView.js";import r from"../../Widget.js";import a from"./ImageViewerViewModel.js";import n from"./NavigationUI.js";import{loadSequentialNavigationUIComponents as s,SequentialNavigationUI as l}from"./SequentialNavigationUI.js";import{loadCalciteComponents as d}from"../../support/componentsUtils.js";import{globalCss as p}from"../../support/globalCss.js";import"../../support/widgetUtils.js";import{vmEvent as c}from"../../support/decorators/vmEvent.js";import{tsx as g}from"../../support/jsxFactory.js";const h="esri-image-viewer";let u=class extends r{constructor(){super(...arguments),this.navigationEnabled=!1,this.uiStrings=null,this.viewModel=new a,this._afterContainerCreate=e=>{this.imageRenderer.container=e},this.addGraphic=(e,t)=>{this.viewModel.addGraphic(e,t)},this.addManyGraphics=e=>{this.viewModel.addManyGraphics(e)},this.clearGraphics=()=>{this.viewModel.clearGraphics()},this.clearImage=()=>{this.viewModel.clearImage()},this.loadImage=async e=>this.viewModel.loadImage(e),this.navigate=async(e,t)=>await this.viewModel.navigate(e,t),this.removeGraphic=e=>{this.viewModel.removeGraphic(e)},this.removeManyGraphics=e=>{this.viewModel.removeManyGraphics(e)}}loadDependencies(){return Promise.all([d({panel:()=>import("@esri/calcite-components/dist/components/calcite-panel")}),s()])}get autoLoad(){return this.viewModel.autoLoad}set autoLoad(e){this.viewModel.autoLoad=e}get brightness(){return this.viewModel.brightness}set brightness(e){this.viewModel.brightness=e}get clickAction(){return this.viewModel.clickAction}set clickAction(e){this.viewModel.clickAction=e}get contrast(){return this.viewModel.contrast}set contrast(e){this.viewModel.contrast=e}get currentNode(){return this.navigationViewModel?.currentNode}get customParameters(){return this.viewModel.customParameters}set customParameters(e){this.viewModel.customParameters=e}get error(){return this.viewModel.error}get imageSize(){const e=this.viewModel.image?.serviceRasterInfo;return e?[e.width,e.height]:[0,0]}get imagePointsInView(){return this.viewModel.imagePointsInView}get imageRenderer(){return this.viewModel.imageRenderer}get imageRotation(){return this.viewModel.imageRotation}set imageRotation(e){this.viewModel.imageRotation=e}get imageSource(){return this.viewModel.imageSource}set imageSource(e){this.viewModel.imageSource=e}get navigationNodes(){return this.navigationViewModel?.navigationNodes}get navigationMode(){return this.navigationViewModel?.navigationMode}get navigationViewModel(){return this.viewModel.navigationViewModel}set navigationViewModel(e){this.viewModel.navigationViewModel=e}get sharpness(){return this.viewModel.sharpness}set sharpness(e){this.viewModel.sharpness=e}get state(){return this.viewModel.state}get ui(){return this.imageRenderer.ui}get _navigationUI(){return g(n,{cameraHeadingThreshold:this.navigationViewModel?.cameraHeadingThreshold,cameraPitchThreshold:this.navigationViewModel?.cameraPitchThreshold,currentNode:this.currentNode,navigate:this.navigate,nodes:this.navigationNodes,preserveAngle:this.navigationViewModel?.preserveAngle??"none"})}get _sequentialNavigationUI(){return g(l,{layout:"horizontal",uiStrings:this.uiStrings,onAction:e=>{this.navigate(this.currentNode,e)}})}_renderNavigationUI(){switch(this.navigationMode){case"directional":return this._navigationUI;case"sequential":return this._sequentialNavigationUI;default:return null}}render(){return g("calcite-panel",{afterCreate:this._afterContainerCreate,bind:this,class:this.classes(p.widget,h)},this.navigationEnabled?this._renderNavigationUI():null)}static{this.vnodeSelector="calcite-panel"}};e([t({type:Boolean})],u.prototype,"autoLoad",null),e([t({type:Number}),t()],u.prototype,"brightness",null),e([t()],u.prototype,"clickAction",null),e([t({type:Number})],u.prototype,"contrast",null),e([t()],u.prototype,"currentNode",null),e([t({type:Object})],u.prototype,"customParameters",null),e([t({readOnly:!0})],u.prototype,"error",null),e([t()],u.prototype,"imageSize",null),e([t({readOnly:!0})],u.prototype,"imagePointsInView",null),e([t({readOnly:!0,type:o})],u.prototype,"imageRenderer",null),e([t()],u.prototype,"imageRotation",null),e([t()],u.prototype,"imageSource",null),e([t({type:Boolean})],u.prototype,"navigationEnabled",void 0),e([t()],u.prototype,"navigationNodes",null),e([t()],u.prototype,"navigationMode",null),e([t()],u.prototype,"navigationViewModel",null),e([t({type:Number})],u.prototype,"sharpness",null),e([t({readOnly:!0})],u.prototype,"state",null),e([t()],u.prototype,"ui",null),e([t()],u.prototype,"uiStrings",void 0),e([c(["click","hittest-response","pixel-location"]),t({type:a})],u.prototype,"viewModel",void 0),e([t()],u.prototype,"_navigationUI",null),e([t()],u.prototype,"_sequentialNavigationUI",null),u=e([i("esri.widgets.OrientedImageryViewer.components.ImageViewer")],u);const m=u;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 e}from"../../../chunks/tslib.es6.js";import t from"../../../Map.js";import i from"../../../core/Error.js";import r from"../../../core/Evented.js";import a from"../../../core/Logger.js";import{clamp as s}from"../../../core/mathUtils.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{isAbortError as n}from"../../../core/promiseUtils.js";import{watch as l,syncAndInitial as m,initial as h}from"../../../core/reactiveUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as g}from"../../../core/accessorSupport/decorators/subclass.js";import{rotate as c,intersect as p,nearestCoordinate as u}from"../../../geometry/geometryEngine.js";import y from"../../../geometry/Point.js";import v from"../../../geometry/Polygon.js";import f from"../../../geometry/SpatialReference.js";import _ from"../../../layers/GraphicsLayer.js";import R from"../../../layers/ImageryTileLayer.js";import w from"../../../layers/support/RasterFunction.js";import{convolutionKernel as x}from"../../../layers/support/rasterFunctionConstants.js";import C from"../../../layers/support/TileInfo.js";import I from"../../../views/MapView.js";import{getResolutionToScaleFactor as b}from"../../../views/2d/viewpointUtils.js";import{logAndThrow as j,getMissingPropertyErrorName as M,getMissingPropertyErrorMessage as P,castImageSource as S}from"../utils.js";const V={click:"click-handle",enhancements:"enhancements-handle"};let k=class extends r.EventedAccessor{constructor(e){super(e),this._imageChanged=!1,this._panConstraint=null,this._image=null,this._loadController=null,this._overlays=new _({blendMode:"source-atop"}),this._map=new t,this.autoLoad=!1,this.clickAction="none",this.error=null,this.imageSource=null,this.imageRotation=0,this.navigationManager=null,this.navigationViewModel=null,this.state="ready",this._cancelLoadWithController=()=>{this._loadController?.abort(),this._loadController=null},this._createImageHandles=()=>{this.removeHandles(V.enhancements),this.addHandles(l((()=>[this.brightness,this.contrast,this.sharpness]),(([e,t,i])=>{this.image?.loaded&&(this.image.effect=`contrast(${10*(t+10)}%) brightness(${10*(e+10)}%)`,this.sharpenImage(this.image,i))}),m))},this._createPanConstraint=()=>{const{image:e,imageRenderer:t}=this,i=i=>{if(!(e&&t&&i.targetGeometry&&e.serviceRasterInfo))return i;const{extent:r}=e.serviceRasterInfo,{constraints:a,rotation:s,width:o,height:n}=t,{extent:l}=c(v.fromExtent(r),s),{width:m,height:h}=l,d=i.targetGeometry.clone(),g=a.scaleToZoom(i.scale),p=1/2**g,y=o/n;let f=p*m,_=p*h;g&&(m/o>h/n?_=f/y:f=_*y);const R=l.clone();return R.xmin+=f/2,R.xmax-=f/2,R.ymin+=_/2,R.ymax-=_/2,i.targetGeometry=u(R,d).coordinate,this.state="image-loaded",i};return{constrain:i,applyPanConstraint:i}},this._createResizeHandles=e=>{e.removeHandles("resize"),e.addHandles(l((()=>{if(!this.imageRenderer.ready)return;const{extent:t}=e.serviceRasterInfo,{width:i,height:r,rotation:a}=this.imageRenderer,{extent:s}=c(v.fromExtent(t),a),{width:o,height:n}=s;return Math.max(o/i,n/r)}),(e=>{if(!this.imageRenderer||null==e)return;const{constraints:t,scale:i,spatialReference:r}=this.imageRenderer,a=t.minScale,s=b(r),o=.25*s,n=s*e;let l=n;const m=[];for(;l>o;)m.push(l),l/=2;m.push(l);const{lods:h}=C.create({scales:m});if(t.set({minScale:n,lods:h}),this._imageChanged)return this.imageRenderer.scale=n,void(this._imageChanged=!1);this.imageRenderer.scale=Math.abs(i-a)<=1e-6?n:i}),m),"resize")},this._loadImageInternal=(e,t={})=>{this.state="image-loading",this.clearImage(),this.error=null,this._imageChanged=!0;const i="string"==typeof e,r=i?void 0:e.datasetFormat,s=i?e:e.url,{customParameters:o,options:l}=t;return this._image=new R({ioConfig:{skipExtensions:["aux.xml","jgw"],skipMapInfo:!0,datasetFormat:r},url:s,customParameters:o}),this._image.when((async e=>{this._updatePanConstraint(),this._createResizeHandles(e),this._map.add(e),this.state="image-loaded"}),(t=>{n(t)?this.state="image-load-aborted":(this.state="image-load-error",this.error=t,a.getLogger(this).error(`error occurred while loading image ${i?e:JSON.stringify(e)}`,t),this.imageSource=null)})),this._image.load(l)},this._loadWithController=()=>{this._cancelLoadWithController(),this._loadController=new AbortController,this.loadImage(this._loadController)},this._loadNavigationManager=async()=>{if(!this.navigationManager||this.navigationManager?.destroyed){const e=await import("../navigation/NavigationManager.js").then((e=>e.default));this.navigationManager=new e({viewModel:this.navigationViewModel})}return this.navigationManager},this._updatePanConstraint=()=>{this._panConstraint&&this.imageRenderer.constraints.customConstraints.remove(this._panConstraint),this._panConstraint=this._createPanConstraint(),this.imageRenderer.constraints.customConstraints.add(this._panConstraint)},this.addGraphic=(e,t)=>{this._overlays.graphics.add(e,t)},this.addManyGraphics=e=>{this._overlays.addMany(e)},this.clearGraphics=()=>{this._overlays.graphics.removeAll()},this.clearImage=()=>{this.image&&(this._map.layers.remove(this.image),this._image=o(this._image))},this.loadImage=e=>{const{customParameters:t,imageSource:r}=this;return r?this._loadImageInternal(r,{customParameters:t,options:e}):j(this.declaredClass,new i(M("image-viewer"),P("ImageViewerViewModel","imageSource")))},this.navigate=async(e,t)=>(await this._loadNavigationManager()).navigate(e,t),this.removeGraphic=e=>{this._overlays.remove(e)},this.removeManyGraphics=e=>{this._overlays.removeMany(e)},this._imageRenderer=new I({constraints:{snapToZoom:!0,rotationEnabled:!1},map:this._map,popupEnabled:!1,spatialReference:f.WebMercator,ui:{components:["zoom"]}})}destroy(){this._imageRenderer.destroy()}initialize(){this.state="initialized",this.addHandles([l((()=>this.imageSource),(e=>{e&&this.autoLoad&&this._loadWithController()}),m),l((()=>this.image?.loaded),(()=>{this._createImageHandles()})),l((()=>this.imageRotation),(()=>{this._rotateImage()})),l((()=>this.imageRenderer.map),((e,t)=>{t?.layers.remove(this._overlays),e?.layers.add(this._overlays)}),h),l((()=>this.imageRenderer.map.allLayers.length),(e=>{e&&this.imageRenderer.map.layers.reorder(this._overlays,e-1)}),m),l((()=>this.clickAction),(e=>{this.removeHandles(V.click),"none"!==e&&this.addHandles(this.imageRenderer.on("click",(t=>{if(this.image?.loaded&&this.imageRenderer.ready)switch(e){case"emit":t.stopPropagation(),this.emit("click",t);break;case"hittest":t.stopPropagation(),t.defer((async()=>{const e=await this.imageRenderer.hitTest(t.screenPoint,{include:this._overlays});e.results=e.results.filter((e=>"graphic"===e.type)),this.emit("hittest-response",e)}));break;case"pixel-location":{if(t.stopPropagation(),!this.image?.serviceRasterInfo||!t.mapPoint)return void this.emit("pixel-location",null);const{extent:e,pixelSize:i}=this.image.serviceRasterInfo,r=(t.mapPoint.x-e.xmin)*i.x,a=(e.ymax-t.mapPoint.y)*i.y,s=new y({x:r,y:a,spatialReference:e.spatialReference});this.emit("pixel-location",s);break}}})))}),m)])}get brightness(){return this._get("brightness")??0}set brightness(e){this._set("brightness",s(e,-10,10))}get contrast(){return this._get("contrast")??0}set contrast(e){this._set("contrast",s(e,-10,10))}get currentNode(){return this.navigationViewModel?.currentNode}get image(){return this._image}get imagePointsInView(){const{extent:e,ready:t}=this.imageRenderer,i=this.imageRotation,r=this.image?.fullExtent,a=this.image?.serviceRasterInfo,s=!0===this._imageRenderer.allLayerViews.find((({layer:e})=>e===this.image))?.attached;if(!(t&&e&&r&&a&&s))return null;const o=c(v.fromExtent(e),i),n=v.fromExtent(r),l=p(o,n),{rings:m}=l;return m.flat().map((([e,t])=>({x:(e-a.extent.xmin)*a.pixelSize.x,y:(a.extent.ymax-t)*a.pixelSize.y})))}get imageSize(){const{image:e}=this;if(!e?.raster)return null;const{width:t,height:i}=e.raster.rasterInfo;return[t,i]}get imageRenderer(){return this._imageRenderer}get imageView(){return this.imageRenderer.allLayerViews.find((e=>e.layer===this.image))}get sharpness(){return this._get("sharpness")??0}set sharpness(e){this._set("sharpness",s(e,0,1))}_rotateImage(){this.imageRenderer.constraints.rotationEnabled=!0,this.imageRenderer.rotation=this.imageRotation,this.imageRenderer.constraints.rotationEnabled=!1}sharpenImage(e,t){if(!t)return void(e.rasterFunction=null);const i=[0,-1*t,0,-1*t,4*t+1,-1*t,0,-1*t,0],r=new w({functionName:"Convolution",functionArguments:{type:x.userDefined,cols:3,rows:3,kernel:i,convolutionType:x.userDefined}});e.rasterFunction=r}};e([d()],k.prototype,"_image",void 0),e([d()],k.prototype,"_imageRenderer",void 0),e([d()],k.prototype,"_loadController",void 0),e([d()],k.prototype,"_overlays",void 0),e([d()],k.prototype,"_map",void 0),e([d({type:Boolean})],k.prototype,"autoLoad",void 0),e([d({type:Number})],k.prototype,"brightness",null),e([d()],k.prototype,"clickAction",void 0),e([d({type:Number})],k.prototype,"contrast",null),e([d()],k.prototype,"currentNode",null),e([d({type:Object})],k.prototype,"customParameters",void 0),e([d({type:i})],k.prototype,"error",void 0),e([d({readOnly:!0})],k.prototype,"image",null),e([d({readOnly:!0})],k.prototype,"imagePointsInView",null),e([d({readOnly:!0})],k.prototype,"imageSize",null),e([d({cast:S})],k.prototype,"imageSource",void 0),e([d({readOnly:!0})],k.prototype,"imageRenderer",null),e([d({type:Number})],k.prototype,"imageRotation",void 0),e([d()],k.prototype,"imageView",null),e([d()],k.prototype,"navigationManager",void 0),e([d()],k.prototype,"navigationViewModel",void 0),e([d({type:Number})],k.prototype,"sharpness",null),e([d()],k.prototype,"state",void 0),k=e([g("esri.widgets.OrientedImageryViewer.components.ImageViewerViewModel")],k);const E=k;export{E as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Map.js";import i from"../../../core/Error.js";import r from"../../../core/Evented.js";import a from"../../../core/Logger.js";import{clamp as s}from"../../../core/mathUtils.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{isAbortError as n}from"../../../core/promiseUtils.js";import{watch as l,syncAndInitial as m,initial as h}from"../../../core/reactiveUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as g}from"../../../core/accessorSupport/decorators/subclass.js";import{rotate as c,intersect as p,nearestCoordinate as u}from"../../../geometry/geometryEngine.js";import y from"../../../geometry/Point.js";import v from"../../../geometry/Polygon.js";import f from"../../../geometry/SpatialReference.js";import _ from"../../../layers/GraphicsLayer.js";import R from"../../../layers/ImageryTileLayer.js";import w from"../../../layers/support/RasterFunction.js";import{convolutionKernel as x}from"../../../layers/support/rasterFunctionConstants.js";import C from"../../../layers/support/TileInfo.js";import I from"../../../views/MapView.js";import{getResolutionToScaleFactor as b}from"../../../views/2d/viewpointUtils.js";import{logAndThrow as j,getMissingPropertyErrorName as M,getMissingPropertyErrorMessage as P,castImageSource as S}from"../utils.js";const V={click:"click-handle",enhancements:"enhancements-handle"};let k=class extends r.EventedAccessor{constructor(e){super(e),this._imageChanged=!1,this._panConstraint=null,this._image=null,this._loadController=null,this._overlays=new _({blendMode:"source-atop"}),this._map=new t,this.autoLoad=!1,this.clickAction="none",this.error=null,this.imageSource=null,this.imageRotation=0,this.navigationManager=null,this.navigationViewModel=null,this.state="ready",this._cancelLoadWithController=()=>{this._loadController?.abort(),this._loadController=null},this._createImageHandles=()=>{this.removeHandles(V.enhancements),this.addHandles(l((()=>[this.brightness,this.contrast,this.sharpness]),(([e,t,i])=>{this.image?.loaded&&(this.image.effect=`contrast(${10*(t+10)}%) brightness(${10*(e+10)}%)`,this.sharpenImage(this.image,i))}),m))},this._createPanConstraint=()=>{const{image:e,imageRenderer:t}=this,i=i=>{if(!(e&&t&&i.targetGeometry&&e.serviceRasterInfo))return i;const{extent:r}=e.serviceRasterInfo,{constraints:a,rotation:s,width:o,height:n}=t,{extent:l}=c(v.fromExtent(r),s),{width:m,height:h}=l,d=i.targetGeometry.clone(),g=a.scaleToZoom(i.scale),p=1/2**g,y=o/n;let f=p*m,_=p*h;g&&(m/o>h/n?_=f/y:f=_*y);const R=l.clone();return R.xmin+=f/2,R.xmax-=f/2,R.ymin+=_/2,R.ymax-=_/2,i.targetGeometry=u(R,d).coordinate,this.state="image-loaded",i};return{constrain:i,applyPanConstraint:i}},this._createResizeHandles=e=>{e.removeHandles("resize"),e.addHandles(l((()=>{if(!this.imageRenderer.ready)return;const{extent:t}=e.serviceRasterInfo,{width:i,height:r,rotation:a}=this.imageRenderer,{extent:s}=c(v.fromExtent(t),a),{width:o,height:n}=s;return Math.max(o/i,n/r)}),(e=>{if(!this.imageRenderer||null==e)return;const{constraints:t,scale:i,spatialReference:r}=this.imageRenderer,a=t.minScale,s=b(r),o=.25*s,n=s*e;let l=n;const m=[];for(;l>o;)m.push(l),l/=2;m.push(l);const{lods:h}=C.create({scales:m});if(t.set({minScale:n,lods:h}),this._imageChanged)return this.imageRenderer.scale=n,void(this._imageChanged=!1);this.imageRenderer.scale=Math.abs(i-a)<=1e-6?n:i}),m),"resize")},this._loadImageInternal=(e,t={})=>{this.state="image-loading",this.clearImage(),this.error=null,this._imageChanged=!0;const i="string"==typeof e,r=i?void 0:e.datasetFormat,s=i?e:e.url,{customParameters:o,options:l}=t;return this._image=new R({ioConfig:{skipExtensions:["aux.xml","jgw"],skipMapInfo:!0,datasetFormat:r},url:s,customParameters:o}),this._image.when((async e=>{this._updatePanConstraint(),this._createResizeHandles(e),this._map.add(e),this.state="image-loaded"}),(t=>{n(t)?this.state="image-load-aborted":(this.state="image-load-error",this.error=t,a.getLogger(this).error(`error occurred while loading image ${i?e:JSON.stringify(e)}`,t),this.imageSource=null)})),this._image.load(l)},this._loadWithController=()=>{this._cancelLoadWithController(),this._loadController=new AbortController,this.loadImage(this._loadController)},this._loadNavigationManager=async()=>{if(!this.navigationManager||this.navigationManager?.destroyed){const e=await import("../navigation/NavigationManager.js").then((e=>e.default));this.navigationManager=new e({viewModel:this.navigationViewModel})}return this.navigationManager},this._updatePanConstraint=()=>{this._panConstraint&&this.imageRenderer.constraints.customConstraints.remove(this._panConstraint),this._panConstraint=this._createPanConstraint(),this.imageRenderer.constraints.customConstraints.add(this._panConstraint)},this.addGraphic=(e,t)=>{this._overlays.graphics.add(e,t)},this.addManyGraphics=e=>{this._overlays.addMany(e)},this.clearGraphics=()=>{this._overlays.graphics.removeAll()},this.clearImage=()=>{this.image&&(this._map.layers.remove(this.image),this._image=o(this._image))},this.loadImage=e=>{const{customParameters:t,imageSource:r}=this;return r?this._loadImageInternal(r,{customParameters:t,options:e}):j(this.declaredClass,new i(M("image-viewer"),P("ImageViewerViewModel","imageSource")))},this.navigate=async(e,t)=>{const i=this._loadNavigationManager();this.navigationViewModel?.addUpdatingPromise(i);const r=await i;return await r.navigate(e,t)},this.removeGraphic=e=>{this._overlays.remove(e)},this.removeManyGraphics=e=>{this._overlays.removeMany(e)},this._imageRenderer=new I({constraints:{snapToZoom:!0,rotationEnabled:!1},map:this._map,popupEnabled:!1,spatialReference:f.WebMercator,ui:{components:["zoom"]}})}destroy(){this._imageRenderer.destroy()}initialize(){this.state="initialized",this.addHandles([l((()=>this.imageSource),(e=>{e&&this.autoLoad&&this._loadWithController()}),m),l((()=>this.image?.loaded),(()=>{this._createImageHandles()})),l((()=>this.imageRotation),(()=>{this._rotateImage()})),l((()=>this.imageRenderer.map),((e,t)=>{t?.layers.remove(this._overlays),e?.layers.add(this._overlays)}),h),l((()=>this.imageRenderer.map.allLayers.length),(e=>{e&&this.imageRenderer.map.layers.reorder(this._overlays,e-1)}),m),l((()=>this.clickAction),(e=>{this.removeHandles(V.click),"none"!==e&&this.addHandles(this.imageRenderer.on("click",(t=>{if(this.image?.loaded&&this.imageRenderer.ready)switch(e){case"emit":t.stopPropagation(),this.emit("click",t);break;case"hittest":t.stopPropagation(),t.defer((async()=>{const e=await this.imageRenderer.hitTest(t.screenPoint,{include:this._overlays});e.results=e.results.filter((e=>"graphic"===e.type)),this.emit("hittest-response",e)}));break;case"pixel-location":{if(t.stopPropagation(),!this.image?.serviceRasterInfo||!t.mapPoint)return void this.emit("pixel-location",null);const{extent:e,pixelSize:i}=this.image.serviceRasterInfo,r=(t.mapPoint.x-e.xmin)*i.x,a=(e.ymax-t.mapPoint.y)*i.y,s=new y({x:r,y:a,spatialReference:e.spatialReference});this.emit("pixel-location",s);break}}})))}),m)])}get brightness(){return this._get("brightness")??0}set brightness(e){this._set("brightness",s(e,-10,10))}get contrast(){return this._get("contrast")??0}set contrast(e){this._set("contrast",s(e,-10,10))}get currentNode(){return this.navigationViewModel?.currentNode}get image(){return this._image}get imagePointsInView(){const{extent:e,ready:t}=this.imageRenderer,i=this.imageRotation,r=this.image?.fullExtent,a=this.image?.serviceRasterInfo,s=!0===this._imageRenderer.allLayerViews.find((({layer:e})=>e===this.image))?.attached;if(!(t&&e&&r&&a&&s))return null;const o=c(v.fromExtent(e),i),n=v.fromExtent(r),l=p(o,n),{rings:m}=l;return m.flat().map((([e,t])=>({x:(e-a.extent.xmin)*a.pixelSize.x,y:(a.extent.ymax-t)*a.pixelSize.y})))}get imageSize(){const{image:e}=this;if(!e?.raster)return null;const{width:t,height:i}=e.raster.rasterInfo;return[t,i]}get imageRenderer(){return this._imageRenderer}get imageView(){return this.imageRenderer.allLayerViews.find((e=>e.layer===this.image))}get sharpness(){return this._get("sharpness")??0}set sharpness(e){this._set("sharpness",s(e,0,1))}_rotateImage(){this.imageRenderer.constraints.rotationEnabled=!0,this.imageRenderer.rotation=this.imageRotation,this.imageRenderer.constraints.rotationEnabled=!1}sharpenImage(e,t){if(!t)return void(e.rasterFunction=null);const i=[0,-1*t,0,-1*t,4*t+1,-1*t,0,-1*t,0],r=new w({functionName:"Convolution",functionArguments:{type:x.userDefined,cols:3,rows:3,kernel:i,convolutionType:x.userDefined}});e.rasterFunction=r}};e([d()],k.prototype,"_image",void 0),e([d()],k.prototype,"_imageRenderer",void 0),e([d()],k.prototype,"_loadController",void 0),e([d()],k.prototype,"_overlays",void 0),e([d()],k.prototype,"_map",void 0),e([d({type:Boolean})],k.prototype,"autoLoad",void 0),e([d({type:Number})],k.prototype,"brightness",null),e([d()],k.prototype,"clickAction",void 0),e([d({type:Number})],k.prototype,"contrast",null),e([d()],k.prototype,"currentNode",null),e([d({type:Object})],k.prototype,"customParameters",void 0),e([d({type:i})],k.prototype,"error",void 0),e([d({readOnly:!0})],k.prototype,"image",null),e([d({readOnly:!0})],k.prototype,"imagePointsInView",null),e([d({readOnly:!0})],k.prototype,"imageSize",null),e([d({cast:S})],k.prototype,"imageSource",void 0),e([d({readOnly:!0})],k.prototype,"imageRenderer",null),e([d({type:Number})],k.prototype,"imageRotation",void 0),e([d()],k.prototype,"imageView",null),e([d()],k.prototype,"navigationManager",void 0),e([d()],k.prototype,"navigationViewModel",void 0),e([d({type:Number})],k.prototype,"sharpness",null),e([d()],k.prototype,"state",void 0),k=e([g("esri.widgets.OrientedImageryViewer.components.ImageViewerViewModel")],k);const E=k;export{E 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"../../../Graphic.js";import o from"../../../core/Accessor.js";import{isSome as i}from"../../../core/arrayUtils.js";import r from"../../../core/Logger.js";import{throwIfAborted as s,isAbortError as n}from"../../../core/promiseUtils.js";import{watch as d,syncAndInitial as a,whenOnce as c}from"../../../core/reactiveUtils.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import p from"../../../geometry/Polygon.js";import{fixedImageSize as u,videoExtent as m}from"../constants.js";import{activePolygonSymbol as v}from"../symbols.js";let V=class extends o{constructor(e){super(e),this.closestFeature=null,this.currentTime=0,this.videoBrightness=1,this.videoContrast=1,this.videoDuration=void 0,this.videoPaused=null,this.videoMuted=null,this.enableAudio=()=>{const{videoElement:e}=this.oiViewModel;e?.content&&(e.content.muted=!1,this.videoMuted=!1)},this.playVideoHandler=()=>{const e=this.oiViewModel.videoElement?.content;e&&(e.paused?e.play().catch((e=>{console.error("Error playing video:",e)})):e.pause())},this.rewindVideoHandler=()=>{const e=this.oiViewModel.videoElement?.content;e&&(e.currentTime=0,e.play().catch((e=>{console.error("Error playing video:",e)})))},this.resetVideoHandler=()=>{const{videoElement:e,videoMapView:t,videoLayer:o}=this.oiViewModel;e?.content&&o&&t&&(e.content.pause(),t.map.layers.remove(o),o.destroy(),this.oiViewModel.videoElement=null)},this.resetVideoEnhancementTools=()=>{this.oiViewModel?.videoLayer&&(this.videoBrightness=1,this.videoContrast=1,this.oiViewModel.videoLayer.effect=`brightness(${this.videoBrightness}) contrast(${this.videoContrast})`)},this.toggleAudio=()=>{const{videoElement:e}=this.oiViewModel;if(e?.content){const t=e.content.muted;e.content.muted=!t,this.videoMuted=!t}}}initialize(){this.addHandles([d((()=>this.oiViewModel.videoElement?.content),(e=>{if(e instanceof HTMLVideoElement){this._startVideo();const t=async()=>{this.currentTime=Number(e.currentTime.toFixed(2)),e.currentTime&&await this._updateVidFootprint(e.currentTime)};e.addEventListener("timeupdate",t),e.addEventListener("play",(()=>this._updateVideoIcon(e.paused))),e.addEventListener("pause",(()=>this._pauseVideoHandler(e)))}}),a),d((()=>this.oiViewModel.layer),((e,t)=>{t&&e&&this.oiViewModel.resetVideo()}),a)])}_pauseVideoHandler(e){this._updateVideoIcon(e.paused)}_setVideoDuration(){const{videoElement:e}=this.oiViewModel;e?.content&&(this.videoDuration=e.content.duration)}async _startVideo(){try{await c((()=>this.oiViewModel.videoElement?.content)),this.enableAudio(),this._setVideoDuration();const e=this.oiViewModel.currentBestFeature;e&&this.playVideoFromSelectedLocation(e)}catch(e){r.getLogger(this).error("oriented-imagery-viewer:video-load",e)}}async _updateVideoFootprintWithGivenFeature(e,o,d){const{activeViewer:a,mode:c,currentCoverageVisible:l,footprintExtent:h}=this.oiViewModel,m="video"===c?u:a?.imageSize;if(o&&m&&h)try{const r=await this.oiViewModel.getMapPoint(e,{feature:o,mode:"default",imageSize:m});s(d);const n=r.filter(i);if(!n.length)return;const a=[n.map((({x:e,y:t})=>[e,t,1]))];a[0].push(a[0][0]);const c=new p({rings:a,spatialReference:n[0].spatialReference});this.oiViewModel.updateCurrentCoveragePolygon(new t({geometry:c,attributes:{imageID:o.attributes.objectId},symbol:v,visible:l}))}catch(V){n(V)||r.getLogger(this).error("update-footprint",V)}else this.oiViewModel.updateCurrentCoveragePolygon(null)}async _updateVidFootprint(e){const t=this.oiViewModel.allLayerFeatures.find((t=>t.attributes.offsetFromStart===Math.floor(e)));t?.attributes.offsetFromStart&&(this.closestFeature=t,await this._updateVideoFootprintWithGivenFeature(m,t))}_updateVideoIcon(e){this.videoPaused=!!e}handleVideoBrightnessChange(e){this.oiViewModel?.videoLayer&&(this.videoBrightness=e??0,this.oiViewModel.videoLayer.effect=`brightness(${this.videoBrightness}) contrast(${this.videoContrast})`)}handleVideoContrastChange(e){this.oiViewModel?.videoLayer&&(this.videoContrast=e??0,this.oiViewModel.videoLayer.effect=`brightness(${this.videoBrightness}) contrast(${this.videoContrast})`)}playVideoFromSelectedLocation(e){const t=e.attributes.offsetFromStart;if(t){const e=this.oiViewModel.videoElement?.content;e&&(e.currentTime=t,e.play().catch((e=>{console.error("Error playing video:",e)})))}}};e([l()],V.prototype,"closestFeature",void 0),e([l()],V.prototype,"currentTime",void 0),e([l()],V.prototype,"oiViewModel",void 0),e([l({type:Number})],V.prototype,"videoBrightness",void 0),e([l({type:Number})],V.prototype,"videoContrast",void 0),e([l()],V.prototype,"videoDuration",void 0),e([l()],V.prototype,"videoPaused",void 0),e([l()],V.prototype,"videoMuted",void 0),V=e([h("esri.widgets.OrientedImageryViewer.components.OrientedImageryVideoViewModel")],V);const y=V;export{y as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Graphic.js";import o from"../../../core/Accessor.js";import{isSome as i}from"../../../core/arrayUtils.js";import r from"../../../core/Logger.js";import{throwIfAborted as s,isAbortError as d}from"../../../core/promiseUtils.js";import{watch as n,syncAndInitial as a}from"../../../core/reactiveUtils.js";import{property as c}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import h from"../../../geometry/Polygon.js";import{fixedImageSize as p,videoExtent as u}from"../constants.js";import{activePolygonSymbol as m}from"../symbols.js";let v=class extends o{constructor(e){super(e),this.closestFeature=null,this.currentTime=0,this.videoBrightness=1,this.videoContrast=1,this.videoDuration=void 0,this.videoPaused=null,this.videoMuted=null,this.enableAudio=()=>{const{videoElement:e}=this.oiViewModel;e?.content&&(e.content.muted=!1,this.videoMuted=!1)},this.playVideoHandler=()=>{const e=this.oiViewModel.videoElement?.content;e&&(e.paused?e.play().catch((e=>{console.error("Error playing video:",e)})):e.pause())},this.rewindVideoHandler=()=>{const e=this.oiViewModel.videoElement?.content;e&&(e.currentTime=0,e.play().catch((e=>{console.error("Error playing video:",e)})))},this.resetVideoHandler=()=>{const{videoElement:e,videoMapView:t,videoLayer:o}=this.oiViewModel;e?.content&&o&&t&&(e.content.pause(),t.map.layers.remove(o),o.destroy(),this.oiViewModel.videoElement=null)},this.resetVideoEnhancementTools=()=>{this.oiViewModel?.videoLayer&&(this.videoBrightness=1,this.videoContrast=1,this.oiViewModel.videoLayer.effect=`brightness(${this.videoBrightness}) contrast(${this.videoContrast})`)},this.toggleAudio=()=>{const{videoElement:e}=this.oiViewModel;if(e?.content){const t=e.content.muted;e.content.muted=!t,this.videoMuted=!t}}}initialize(){this.addHandles([n((()=>this.oiViewModel.videoElement?.content),(e=>{if(e instanceof HTMLVideoElement){this._startVideo();const t=async()=>{this.currentTime=Number(e.currentTime.toFixed(2)),e.currentTime&&await this._updateVidFootprint(e.currentTime)};e.addEventListener("timeupdate",t),e.addEventListener("play",(()=>this._updateVideoIcon(e.paused))),e.addEventListener("pause",(()=>this._pauseVideoHandler(e)))}}),a),n((()=>this.oiViewModel.layer),((e,t)=>{t&&e&&e.uid!==t.uid&&this.oiViewModel.resetVideo()}),a)])}destroy(){this.resetVideoHandler()}_pauseVideoHandler(e){this._updateVideoIcon(e.paused)}_setVideoDuration(){const{videoElement:e}=this.oiViewModel;e?.content&&(this.videoDuration=e.content.duration)}_startVideo(){try{this.enableAudio(),this._setVideoDuration();const e=this.oiViewModel.currentBestFeature;e&&this.playVideoFromSelectedLocation(e)}catch(e){r.getLogger(this).error("oriented-imagery-viewer:video-load",e)}}async _updateVideoFootprintWithGivenFeature(e,o,n){const{activeViewer:a,mode:c,currentCoverageVisible:l,footprintExtent:u}=this.oiViewModel,v="video"===c?p:a?.imageSize;if(o&&v&&u)try{const r=await this.oiViewModel.getMapPoint(e,{feature:o,mode:"default",imageSize:v});s(n);const d=r.filter(i);if(!d.length)return;const a=[d.map((({x:e,y:t})=>[e,t,1]))];a[0].push(a[0][0]);const c=new h({rings:a,spatialReference:d[0].spatialReference});this.oiViewModel.updateCurrentCoveragePolygon(new t({geometry:c,attributes:{imageID:o.attributes.objectId},symbol:m,visible:l}))}catch(V){d(V)||r.getLogger(this).error("update-footprint",V)}else this.oiViewModel.updateCurrentCoveragePolygon(null)}async _updateVidFootprint(e){const t=this.oiViewModel.allLayerFeatures.find((t=>t.attributes.offsetFromStart===Math.floor(e)));t?.attributes.offsetFromStart&&(this.closestFeature=t,await this._updateVideoFootprintWithGivenFeature(u,t))}_updateVideoIcon(e){this.videoPaused=!!e}handleVideoBrightnessChange(e){this.oiViewModel?.videoLayer&&(this.videoBrightness=e??0,this.oiViewModel.videoLayer.effect=`brightness(${this.videoBrightness}) contrast(${this.videoContrast})`)}handleVideoContrastChange(e){this.oiViewModel?.videoLayer&&(this.videoContrast=e??0,this.oiViewModel.videoLayer.effect=`brightness(${this.videoBrightness}) contrast(${this.videoContrast})`)}playVideoFromSelectedLocation(e){const t=e.attributes.offsetFromStart;if(t){const e=this.oiViewModel.videoElement?.content;e&&(e.currentTime=t,e.play().catch((e=>{console.error("Error playing video:",e)})))}}};e([c()],v.prototype,"closestFeature",void 0),e([c()],v.prototype,"currentTime",void 0),e([c()],v.prototype,"oiViewModel",void 0),e([c({type:Number})],v.prototype,"videoBrightness",void 0),e([c({type:Number})],v.prototype,"videoContrast",void 0),e([c()],v.prototype,"videoDuration",void 0),e([c()],v.prototype,"videoPaused",void 0),e([c()],v.prototype,"videoMuted",void 0),v=e([l("esri.widgets.OrientedImageryViewer.components.OrientedImageryVideoViewModel")],v);const V=v;export{V 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 r from"../../../core/Accessor.js";import{throwIfAborted as t}from"../../../core/promiseUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{createCoveragePolygon as s}from"../../../layers/orientedImagery/core/coverageUtils.js";import n from"../../../layers/orientedImagery/core/ExposurePoint.js";import{InvalidDirectionError as a,FeatureSectorNotFoundError as l}from"./errors.js";import{queryNextLocationFeatures as c,querySequenceCount as d,queryAfterSequenceField as u,querySequenceFeaturesAroundPoint as g,queryOffsetSequenceFeatures as p}from"./queries.js";import{translateInDirection2D as w}from"./utils.js";let f=class extends r{constructor(e){super(e),this.viewModel=null}get currentNode(){return this.viewModel.currentNode}get layer(){return this.viewModel.layer}get navigationNodes(){return this.viewModel.navigationNodes}async _queryAndHandleFeatureResponse(e,r,o,i,s){const{error:n,nextLocation:a,response:l}=await c(e,r,o,i,s);if(t(s),n)throw n;this.viewModel.selectedPoint=a,await this.viewModel.processFeatureResponse(l,a,{signal:s?.signal,loadBestImage:!1,skipFilter:!0})}async afterNavigate(e,r,t){return await this.viewModel.selectBestFeature(r.id,t),r}async navigate(e,r){let t;if("direction"in r?t=await this.navigateInDirection(e,r):("step"in r||"goTo"in r)&&(t=await this.navigateInSequence(e,r)),!t)throw new Error("No next node found");return await this.afterNavigate(e,t,r)}async navigateBySkippingSteps(e,r){const{step:t}=r,{layer:o}=this,{floorFilterClause:i}=this.viewModel;if(!o)throw new Error("Layer is not defined");const a=e.attributes.sequenceOrder;if(0===await d(o,i,{signal:r.signal})||!a)throw new Error("No sequence found");const{response:l,error:c}=await u(o,a,t,1,i,{signal:r.signal});if(c)throw new Error("Error querying sequence features");const p=l?.features[0];if(!p)throw new Error("No next node found");const w=n.fromJSON({...p.toJSON(),layer:o}),{response:f,error:h,nextLocation:v}=await g(o,s(w).polygon.centroid,i,{signal:r.signal});if(h)throw new Error("Error querying sequence features");const y=[...f.features];y.push(p),f.features=y,this.viewModel.selectedPoint=null;const m=p.attributes.objectId;return await this.viewModel.processFeatureResponse(f,v,{signal:r.signal,loadBestImage:!1,skipFilter:!0}),this.viewModel.selectedPoint=v,this.viewModel.navigationNodes.find((e=>e.id===m))}async navigateInDirection(e,r){const{viewModel:t}=this,{layer:o,floorFilterClause:i}=t,{direction:s,signal:n}=r,c=e?.[s];if(!c)throw new a(s);const d=t.getFeatureSectorById(c.id);if(!d)throw new l(c);const[u,g]=d.split("_"),p=g??u,f=`NEAR_${p}`,v=`FAR_${p}`,y=t.getActiveSectors();h(d,y.includes(f),y.includes(v),p,f,v)&&await this._queryAndHandleFeatureResponse(o,e,c,i,{signal:n});const{currentHeading:m,currentPitch:M}=e,{attributes:{farDistance:N,isNadir:E,cameraPitch:S},geometry:j}=c,q=N;return this.viewModel.selectedPoint=E||S<10?j.clone():w(j,m,M,q),c}async navigateInSequence(e,r){return"step"in r?this.navigateBySkippingSteps(e,r):this.navigateTo(r)}async navigateTo(e){const{goTo:r}=e,{layer:t}=this,{floorFilterClause:o}=this.viewModel;if(!t)throw new Error("Layer is not defined");const i="number"==typeof r?r:1,{response:a,error:l}=await p(t,i,1,"end"===r?"DESC":"ASC",o,{signal:e.signal});if(l)throw new Error("Error querying sequence features");const c=a?.features[0];if(!c)throw new Error("No next node found");const d=n.fromJSON({...c.toJSON(),layer:t}),{polygon:u}=s(d),{response:w,error:f,nextLocation:h}=await g(t,u.centroid,o,{signal:e.signal});if(f)throw new Error("Error querying sequence features");const v=[...w.features];v.push(c),w.features=v,this.viewModel.selectedPoint=null;const y=c.attributes.objectId;return await this.viewModel.processFeatureResponse(w,h,{signal:e.signal,loadBestImage:!1,skipFilter:!0}),this.viewModel.selectedPoint=h,this.viewModel.navigationNodes.find((e=>e.id===y))}};function h(e,r,t,o,i,s){return e===s||e===i&&!t||e===o&&!r&&!t}e([o()],f.prototype,"currentNode",null),e([o()],f.prototype,"layer",null),e([o()],f.prototype,"navigationNodes",null),e([o({constructOnly:!0})],f.prototype,"viewModel",void 0),f=e([i("esri.widgets.OrientedImageryViewer.navigation.NavigationManager")],f);export{f as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Accessor.js";import{throwIfAborted as t}from"../../../core/promiseUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{createCoveragePolygon as s}from"../../../layers/orientedImagery/core/coverageUtils.js";import n from"../../../layers/orientedImagery/core/ExposurePoint.js";import{InvalidDirectionError as a,FeatureSectorNotFoundError as l}from"./errors.js";import{queryNextLocationFeatures as c,querySequenceCount as d,queryAfterSequenceField as u,querySequenceFeaturesAroundPoint as g,queryOffsetSequenceFeatures as w}from"./queries.js";let p=class extends r{constructor(e){super(e),this.viewModel=null}get currentNode(){return this.viewModel.currentNode}get layer(){return this.viewModel.layer}get navigationNodes(){return this.viewModel.navigationNodes}async _queryAndHandleFeatureResponse(e,r,o,i){const{error:s,nextLocation:n,response:a}=await c(e,r,o,i);if(t(i),s)throw s;this.viewModel.selectedPoint=n,await this.viewModel.processFeatureResponse(a,n,{signal:i?.signal,loadBestImage:!1})}async afterNavigate(e,r,t){return await this.viewModel.selectBestFeature(r.id,t),r}async navigate(e,r){let t,o;if("direction"in r?o=this.navigateInDirection(e,r):("step"in r||"goTo"in r)&&(o=this.navigateInSequence(e,r)),o&&(this.viewModel?.addUpdatingPromise(o),t=await o),!t)throw new Error("No next node found");return await this.afterNavigate(e,t,r)}async navigateBySkippingSteps(e,r){const{step:t}=r,{layer:o}=this,{floorFilterClause:i}=this.viewModel;if(!o)throw new Error("Layer is not defined");const a=e.attributes.sequenceOrder;if(0===await d(o,i,{signal:r.signal})||!a)throw new Error("No sequence found");const{response:l,error:c}=await u(o,a,t,1,i,{signal:r.signal});if(c)throw new Error("Error querying sequence features");const w=l?.features[0];if(!w)throw new Error("No next node found");const p=n.fromJSON({...w.toJSON(),layer:o}),{response:f,error:h,nextLocation:v}=await g(o,s(p).polygon.centroid,i,{signal:r.signal});if(h)throw new Error("Error querying sequence features");const y=[...f.features];y.push(w),f.features=y,this.viewModel.selectedPoint=v;const m=w.attributes.objectId;return await this.viewModel.processFeatureResponse(f,v,{signal:r.signal,loadBestImage:!1}),this.viewModel.selectedPoint=v,this.viewModel.navigationNodes.find((e=>e.id===m))}async navigateInDirection(e,r){const{viewModel:t}=this,{layer:o,floorFilterClause:i}=t,{direction:s,signal:n}=r,c=e?.[s];if(!c)throw new a(s);const d=t.getFeatureSectorById(c.id);if(!d)throw new l(c);const[u,g]=d.split("_"),w=g??u,p=`NEAR_${w}`,h=`FAR_${w}`,v=t.getActiveSectors();return f(d,v.includes(p),v.includes(h),w,p,h)&&await this._queryAndHandleFeatureResponse(o,c,i,{signal:n}),c}async navigateInSequence(e,r){return"step"in r?this.navigateBySkippingSteps(e,r):this.navigateTo(r)}async navigateTo(e){const{goTo:r}=e,{layer:t}=this,{floorFilterClause:o}=this.viewModel;if(!t)throw new Error("Layer is not defined");const i="number"==typeof r?r:1,a=this.viewModel.navigationNodes.find((e=>e.id===i));if(a)return a;const{response:l,error:c}=await w(t,i,1,"end"===r?"DESC":"ASC",o,{signal:e.signal});if(c)throw new Error("Error querying sequence features");const d=l?.features[0];if(!d)throw new Error("No next node found");const u=n.fromJSON({...d.toJSON(),layer:t}),{polygon:p}=s(u),{response:f,error:h,nextLocation:v}=await g(t,p.centroid,o,{signal:e.signal});if(h)throw new Error("Error querying sequence features");const y=[...f.features];y.push(d),f.features=y,this.viewModel.selectedPoint=v;const m=d.attributes.objectId;return await this.viewModel.processFeatureResponse(f,v,{signal:e.signal,loadBestImage:!1}),this.viewModel.selectedPoint=v,this.viewModel.navigationNodes.find((e=>e.id===m))}};function f(e,r,t,o,i,s){return e===s||e===i&&!t||e===o&&!r&&!t}e([o()],p.prototype,"currentNode",null),e([o()],p.prototype,"layer",null),e([o()],p.prototype,"navigationNodes",null),e([o({constructOnly:!0})],p.prototype,"viewModel",void 0),p=e([i("esri.widgets.OrientedImageryViewer.navigation.NavigationManager")],p);export{p 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{sqlAnd as e}from"../../../core/sql.js";import{searchImages as r}from"../../../layers/orientedImagery/queries.js";import{featureDistanceFactor as t}from"../constants.js";import{translateInDirection2D as n}from"./utils.js";async function o(e,o,i,s,c){const{currentHeading:a,currentPitch:u}=o,{attributes:{farDistance:d},geometry:f}=i,l=n(f,a,u,d/t),w=m(e.definitionExpression,s);let h,p;try{h=await r({layerInstanceOrURL:e,point:l,queryParams:{where:w}},c)}catch($){p=$}return new y(l,h,p)}async function i(e,t,n,o){const i=e.sequenceOrderField??"SequenceOrder",s=m(e.definitionExpression,n,`${i} IS NOT NULL`);let c,a;try{c=await r({layerInstanceOrURL:e,point:t,queryParams:{where:s,orderByFields:[`${i}`],returnGeometry:!0,outFields:["*"]}},o)}catch(u){a=u}return new y(t,c,a)}function s(e,r,t){const n=e.sequenceOrderField,o=m(e.definitionExpression,r,`${n} IS NOT NULL`);return e.queryFeatureCount({where:o},t)}async function c(r,t,n,o="ASC",i,s){const c=r.sequenceOrderField??"SequenceOrder";let a=m(r.definitionExpression,i,`${c} IS NOT NULL`);const u="number"==typeof t?t-1:void 0;"string"===t&&(a=e(a,`${c} = ${t}`));try{const e=await r.queryFeatures({where:a,returnGeometry:!0,orderByFields:[`${c} ${o}`],outFields:["*"],start:u,num:n},s);return await w(e,r),new d(e)}catch(y){return new d(void 0,y)}}async function a(e,r,t=0,n=1,o,i){const s=e.sequenceOrderField??"SequenceOrder",c=l(s,t),a=m(e.definitionExpression,o,f(t,r,s));try{const r=await e.queryFeatures({where:a,orderByFields:c,num:n,outFields:["*"],returnGeometry:!0},i);return await w(r,e),new d(r)}catch(u){return new d(void 0,u)}}async function u(e,r,t,n){const o=Array.isArray(r)?r:[r],i=m(e.definitionExpression,t,`${e.objectIdField} IN (${o.join(",")})`);try{const r=await e.queryFeatures({where:i,outFields:["*"],returnGeometry:!0},n);return await w(r,e),new d(r)}catch(s){return new d(void 0,s)}}class d{constructor(e,r){this.response=e,this.error=r}}class y{constructor(e,r,t){this.nextLocation=e,this.response=r,this.error=t}}function f(e,r,t){return e>0?`${t} IS NOT NULL AND ${t} > ${r}`:`${t} IS NOT NULL AND ${t} < ${r}`}function l(e,r){return r>0?[`${e}`]:[`${e} DESC`]}async function w(e,r){const t=await import("../../../layers/orientedImagery/core/ExposurePoint.js").then((e=>e.default));e.features.forEach((e=>{const n=t.fromJSON({...e.toJSON(),layer:r});n&&(e.attributes=n)}))}function m(...r){let t="1=1";return r.forEach((r=>{t=e(t,r)})),t}export{y as QueryNextLocationFeaturesResponse,d as QueryOrientedImageryFeaturesResponse,a as queryAfterSequenceField,u as queryFeatureByObjectIds,o as queryNextLocationFeatures,c as queryOffsetSequenceFeatures,s as querySequenceCount,i as querySequenceFeaturesAroundPoint};
5
+ import{sqlAnd as e}from"../../../core/sql.js";import{searchImages as r}from"../../../layers/orientedImagery/queries.js";import{createCoveragePolygon as t}from"../../../layers/orientedImagery/core/coverageUtils.js";async function n(e,n,o,i){const s=t(n.attributes).polygon.centroid;s.z=void 0;const c=w(e.definitionExpression,o);let a,u;try{a=await r({layerInstanceOrURL:e,point:s,queryParams:{where:c}},i)}catch(y){u=y}return new d(s,a,u)}async function o(e,t,n,o){const i=e.sequenceOrderField??"SequenceOrder",s=w(e.definitionExpression,n,`${i} IS NOT NULL`);let c,a;try{c=await r({layerInstanceOrURL:e,point:t,queryParams:{where:s,orderByFields:[`${i}`],returnGeometry:!0,outFields:["*"]}},o)}catch(u){a=u}return new d(t,c,a)}function i(e,r,t){const n=e.sequenceOrderField,o=w(e.definitionExpression,r,`${n} IS NOT NULL`);return e.queryFeatureCount({where:o},t)}async function s(r,t,n,o="ASC",i,s){const c=r.sequenceOrderField??"SequenceOrder";let a=w(r.definitionExpression,i,`${c} IS NOT NULL`);const d="number"==typeof t?t-1:void 0;"string"===t&&(a=e(a,`${c} = ${t}`));try{const e=await r.queryFeatures({where:a,returnGeometry:!0,orderByFields:[`${c} ${o}`],outFields:["*"],start:d,num:n},s);return await f(e,r),new u(e)}catch(y){return new u(void 0,y)}}async function c(e,r,t=0,n=1,o,i){const s=e.sequenceOrderField??"SequenceOrder",c=l(s,t),a=w(e.definitionExpression,o,y(t,r,s));try{const r=await e.queryFeatures({where:a,orderByFields:c,num:n,outFields:["*"],returnGeometry:!0},i);return await f(r,e),new u(r)}catch(d){return new u(void 0,d)}}async function a(e,r,t,n){const o=Array.isArray(r)?r:[r],i=w(e.definitionExpression,t,`${e.objectIdField} IN (${o.join(",")})`);try{const r=await e.queryFeatures({where:i,outFields:["*"],returnGeometry:!0},n);return await f(r,e),new u(r)}catch(s){return new u(void 0,s)}}class u{constructor(e,r){this.response=e,this.error=r}}class d{constructor(e,r,t){this.nextLocation=e,this.response=r,this.error=t}}function y(e,r,t){return e>0?`${t} IS NOT NULL AND ${t} > ${r}`:`${t} IS NOT NULL AND ${t} < ${r}`}function l(e,r){return r>0?[`${e}`]:[`${e} DESC`]}async function f(e,r){const t=await import("../../../layers/orientedImagery/core/ExposurePoint.js").then((e=>e.default));e.features.forEach((e=>{const n=t.fromJSON({...e.toJSON(),layer:r});n&&(e.attributes=n)}))}function w(...r){let t="1=1";return r.forEach((r=>{t=e(t,r)})),t}export{d as QueryNextLocationFeaturesResponse,u as QueryOrientedImageryFeaturesResponse,c as queryAfterSequenceField,a as queryFeatureByObjectIds,n as queryNextLocationFeatures,s as queryOffsetSequenceFeatures,i as querySequenceCount,o as querySequenceFeaturesAroundPoint};
@@ -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{deg2rad as e}from"../../../core/mathUtils.js";import{getMetersPerUnitForSR as t}from"../../../core/unitUtils.js";import n from"../../../geometry/Extent.js";function r(n,r,i,o){const a=Math.sin(e(r)),s=Math.cos(e(r)),c=Math.sin(e(i)),m=o/t(n.spatialReference),f=m*a*c,p=m*s*c,x=n.clone();return x.x+=f,x.y+=p,x}function i(e,r){const{x:i,y:o,spatialReference:a}=e,s=r/t(a);return new n({xmin:i-s,xmax:i+s,ymin:o-s,ymax:o+s,spatialReference:e.spatialReference})}export{i as createExtentAroundPoint,r as translateInDirection2D};
5
+ import{getMetersPerUnitForSR as e}from"../../../core/unitUtils.js";import r from"../../../geometry/Extent.js";import{getWebMercatorScalingFactor as t}from"../../../layers/orientedImagery/transformations/utils.js";function n(n,i){const{x:o,y:m,spatialReference:a}=n,s=i*t(m,a)/e(a);return new r({xmin:o-s,xmax:o+s,ymin:m-s,ymax:m+s,spatialReference:n.spatialReference})}export{n as createExtentAroundPoint};
@@ -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 n}from"../core/promiseUtils.js";import{watch as r,initial as l,syncAndInitial as d,whenOnce as c}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 h}from"../core/accessorSupport/decorators/subclass.js";import{or as m}from"../layers/orientedImagery/transformations/utils.js";import u from"./Expand.js";import v from"./PanoramicViewer.js";import p from"./Widget.js";import{getAllArcPath as y}from"./OrientedImageryViewer/arcUtils.js";import{getDelegatedEvents as w,defaultImageGeometryField as _,defaultOIObjectIDField as T,segmentArcs as M,featureCircleRadius as b,navigationToolDimensionLength as C,sectorsRadii as A}from"./OrientedImageryViewer/constants.js";import{css as I,navigation as f,navigationToolRotationFrom as L,navigationToolRotationTo as k,root as V}from"./OrientedImageryViewer/css.js";import{loadImageForAttachment as S,getThumbnailPixelBlock as O,isFeatureAttachment as E,renderImageWithRotation as F}from"./OrientedImageryViewer/galleryUtils.js";import P from"./OrientedImageryViewer/OrientedImageryViewerViewModel.js";import x from"./OrientedImageryViewer/OrientedImageryViewerVisibleElements.js";import{loadAlertComponents as H,Alert as j}from"./OrientedImageryViewer/components/Alert.js";import G from"./OrientedImageryViewer/components/ImageLocationWidget.js";import D from"./OrientedImageryViewer/components/ImageViewer.js";import $ from"./OrientedImageryViewer/components/NavigationAction.js";import{NavigationActionsCollection as N,NavigationActions as B}from"./OrientedImageryViewer/components/NavigationActions.js";import{NoImageLoadedError as R}from"./OrientedImageryViewer/navigation/errors.js";import{loadCalciteComponents as W}from"./support/componentsUtils.js";import{globalCss as U}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as z}from"./support/decorators/messageBundle.js";import{vmEvent as q}from"./support/decorators/vmEvent.js";import{tsx as Z,tsxFragment as J}from"./support/jsxFactory.js";import{substitute as K}from"../intl/substitute.js";const Q={overlayed:"overlayed"};let X=class extends p{constructor(e,t){super(e,t),this.dataCaptureEnabled=!1,this.galleryOpened=!1,this.imageEnhancementToolActive=!1,this.videoEnhancementToolActive=!1,this.imageOverlaysOpened=!1,this.navigationToolActive=!1,this.viewModel=new P,this.messagesCommon=null,this.messagesSketch=null,this.pixelMeasurementUnit="meters",this.pixelAreaMeasurementUnit="square-meters",this.showCameraLocations=!1,this.showMapFeatures=!1,this.visibleElements=new x,this._imageOverlaysLoaderTask=null,this._imageMeasurementToolsLoaderTask=null,this._navigationSettingsLoaderTask=null,this._clearMeasurements=()=>{this.viewModel.measureType=null,this.viewModel.clearPreviousMeasurements()},this._clearImageLocation=()=>{this.imageLocationToolActive=!1},this._navigationToolExpanded=!1,this._navigationTool=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._handleNavigationSettingsInputChange=(e,t)=>{this.set(`${e}Threshold`,t)},this._handleNavigationSettingsToggle=e=>{this.viewModel.preserveAngle=e},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(r((()=>t.visible),(()=>{this.viewModel.toggleOverlayMapFeatures(t.id,t.visible)})),`${Q.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,n="select-feature"===s,r=s!==i;switch(i){case"draw-point":case"draw-polygon":case"draw-polyline":{a&&m(n,o&&r)&&(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._settingsToggle=null,this._toggleImageNavigation=async e=>{const t=this.navigationMode;this._closeAllImageTools(),this.navigationMode=t!==e?e:null;const{activeViewer:i}=this.viewModel;if(!i)return;const{mode:a,preserveAngle:s}=this.viewModel;if("default"===a)if("directional"===this.navigationMode){const e=await this._loadNavigationSettings(),t="heading"===s||"both"===s,i="pitch"===s||"both"===s,{messages:a,messagesCommon:o}=this,n=new e({cameraHeadingThreshold:this.cameraHeadingThreshold,cameraPitchThreshold:this.cameraPitchThreshold,uiStrings:{configureNavigation:a.configureNavigation,preserveHeading:a.preserveHeading,preserveHeadingDescription:a.preserveHeadingDescription,preservePitch:a.preservePitch,preservePitchDescription:a.preservePitchDescription,settings:o.settings,thresholdLabel:a.thresholdLabel},onInputChange:this._handleNavigationSettingsInputChange,onToggle:this._handleNavigationSettingsToggle,preserveHeading:t,preservePitch:i});this._settingsToggle=new u({content:n,expandIcon:"configure"}),this.viewModel.activeViewer?.ui.add(this._settingsToggle,{position:"top-left"})}else this._settingsToggle&&(this._settingsToggle.expanded=!1,this.viewModel.activeViewer?.ui.remove(this._settingsToggle))},this._toggleImageAttributes=()=>{this.viewModel.toggleImageAttributes()},this.navigate=async e=>{let t=null;try{const{currentNode:i}=this.viewModel;if(!i)throw new R;t=await this.viewModel.navigate(i,e)}catch(i){n(i)||o.getLogger(this).error("Error occurred while navigating",i)}return t},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([r((()=>[this.viewModel?.bestFeatureAngle,this._navigationTool]),(([e,t])=>{t&&this._updateNavigationTool(t)}),l),r((()=>this.currentCoverageVisible),(e=>this._onCurrentCoverageVisibilityChange(e))),r((()=>this.isAdditionalCoverageVisible),(e=>this._onAdditionalCoverageVisibilityChange(e))),r((()=>this.isAdditionalPointSourcesVisible),(e=>this._onAdditionalCameraLocationsVisibility(e))),r((()=>({features:this.currentBestFeature,showCameraLocations:this.showCameraLocations,state:this.viewModel.state})),(({showCameraLocations:e,state:t})=>{"image-loaded"===t&&this.viewModel.overlayCameraLocations(e)}),d),r((()=>({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 c((()=>"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 Promise.all([W({"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"),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")}),H()])}destroy(){this._galleryController.abort(),this._galleryObserver.disconnect(),this.currentBestFeature=null}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 activeVideoIcon(){const{videoElement:e,videoViewModel:t}=this.viewModel;return e?.loaded&&t?t.videoPaused?"play":"pause":"play"}get activeAudioIcon(){const{videoElement:e,videoViewModel:t}=this.viewModel;return e?.loaded&&t?.videoMuted?"sound-off":"sound"}get cameraHeadingThreshold(){return this.viewModel.cameraHeadingThreshold}set cameraHeadingThreshold(e){this.viewModel.cameraHeadingThreshold=e}get cameraPitchThreshold(){return this.viewModel.cameraPitchThreshold}set cameraPitchThreshold(e){this.viewModel.cameraPitchThreshold=e}get canNavigateSequentially(){const{layer:e}=this;if(!e)return!1;const{fields:t,sequenceOrderField:i}=e;return t.some((({name:e})=>e.toLowerCase()===`${i??"sequenceorder"}`.toLowerCase()))}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 navigationMode(){return this.viewModel.navigationMode}set navigationMode(e){this.viewModel.navigationMode=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 triangularMeasurementActive(){return this.viewModel.triangularMeasurementActive}set triangularMeasurementActive(e){this.viewModel.triangularMeasurementActive=e}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 Z("calcite-action-bar",{expandDisabled:!0,layout:"horizontal",slot:"action-bar"},Z("calcite-action-group",null,this._currentFootprintToggle(),this._additionalFootprintToggle(),this._additionalPointSourcesToggle()),Z("calcite-action-group",null,this._directionToolToggle(),this._mapImageConversionToggle(),this._navigationToolToggle(),this._imageEnhancementsToggle(),this._videoEnhancementsToggle()),Z("calcite-action-group",null,this._measurementToolsToggle(),this._imageGalleryToggle(),this._imageOverlaysToggle(),this._openPopupAction()))}_renderEnhancementSlider({title:e,value:t,handleChange:i}){return Z("div",{class:I.imageEnhancementToolContainer},Z("calcite-label",null,e,Z("calcite-slider",{bind:this,labelTicks:!0,max:10,min:0,ticks:2,value:t,onCalciteSliderInput:i})))}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,triangularMeasurementActive:i}=this,{groundArea:a,heightAboveGround:s,groundDistance:o,triangulatedAreaHeading:n,triangulatedDistanceHeading:r}=t;if(i)return"area"===e?n:r;switch(e){case"area":return a;case"height":return s;default:return o}}_additionalFootprintToggle(){const{isAdditionalCoverageVisible:e,invalidCameraHeading:t,visibleElements:{additionalFootprintToggle:i}}=this;return i?Z("calcite-action",{active:e,bind:this,class:I.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?Z("calcite-action",{active:e,bind:this,class:I.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,currentBestFeatureMeasurementImage:i},triangularMeasurementActive:a,id:s}=this;if("image-loaded"!==e||!t||a&&!i)return;this._imageMeasurementToolsLoaderTask||this._loadImageMeasurementResources();const o=this._imageMeasurementToolsLoaderTask?.value;return o?Z("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},Z(o,{measurementType:t,measurementUnitMessages:this.measurementUnitMessages,messages:this.messages,oiViewModel:this.viewModel})):null}get _renderRoot(){const{viewModel:{state:e},triangularMeasurementActive:t}=this;return Z("calcite-panel",{bind:this,class:t?I.viewerContainerMeasurement:I.viewerContainer,heading:this.visibleElements.title?this.messages.title:void 0,loading:e.includes("loading")&&!t},this.visibleElements.menu?this._renderActionBar():null,Z("calcite-shell",null,Z("calcite-panel",null,this._imageViewer,this._panoramicViewer,this._videoViewer,this._messageBox,this.invalidCameraHeading?this._renderWarning(this.messages.invalidCameraHeadingWarningTitle,this.messages.invalidCameraHeadingWarningDescription):[this._imageGalleryPanel,this._renderNavigation,this._imageOverlaysPanel()],this._imageEnhancementTools,this._videoEnhancementTools,this._renderSketch()),this._imageViewerTriangular,this._measurementToggle,this._locationToggle))}_currentFootprintToggle(){const{currentCoverageVisible:e,invalidCameraHeading:t}=this,{currentFootprintToggle:i}=this.visibleElements;return i?Z("calcite-action",{active:e,bind:this,class:I.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?Z("calcite-panel",{bind:this,class:I.imageEnhancementWrapper,closable:!0,closed:!e,heading:this.messages.imageEnhancement,key:this.messages.imageEnhancement,onCalcitePanelClose:this._toggleImageEnhancementToolState},Z("div",{class:I.imageEnhancementTools},Z("div",{class:I.imageEnhancementToolContainer},Z("calcite-label",null,this.messages.brightness,Z("calcite-slider",{bind:this,labelTicks:!0,max:10,min:-10,ticks:5,value:t,onCalciteSliderInput:this._handleBrightnessChange}))),Z("div",{class:I.imageEnhancementToolContainer},Z("calcite-label",null,this.messages.contrast,Z("calcite-slider",{bind:this,labelTicks:!0,max:10,min:-10,ticks:5,value:i,onCalciteSliderInput:this._handleContrastChange}))),Z("div",{class:I.imageEnhancementToolContainer},Z("calcite-label",null,this.messages.sharpness,Z("calcite-slider",{bind:this,labelTicks:!0,max:1,min:0,step:.1,ticks:.5,value:a,onCalciteSliderInput:this._handleSharpnessChange})))),Z("calcite-action",{bind:this,icon:"reset",onclick:this._resetImageTools,slot:"header-actions-end",text:this.messagesCommon.reset,title:this.messagesCommon.reset})):null}get _videoEnhancementTools(){const{videoEnhancementToolActive:e,viewModel:{videoViewModel:t,mode:i},messages:{videoEnhancement:a,brightness:s,contrast:o},messagesCommon:{reset:n}}=this;return e&&"video"===i&&t?Z("calcite-panel",{bind:this,class:I.imageEnhancementWrapper,closable:!0,closed:!e,heading:a,key:a,onCalcitePanelClose:this._toggleVideoEnhancementToolState},Z("div",{class:I.imageEnhancementTools},this._renderEnhancementSlider({title:s,value:t.videoBrightness,handleChange:this._handleVideoBrightnessChange}),this._renderEnhancementSlider({title:o,value:t.videoContrast,handleChange:this._handleVideoContrastChange})),Z("calcite-action",{bind:this,icon:"reset",onclick:this._resetVideoTools,slot:"header-actions-end",text:n})):null}_imageEnhancementsToggle(){const{state:e,mode:t}=this.viewModel,{imageEnhancement:i}=this.visibleElements;return i&&"video"!==t?Z("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}_videoEnhancementsToggle(){const{mode:e}=this.viewModel,{videoEnhancement:t}=this.messages;return"video"===e?Z("calcite-action",{active:this.imageEnhancementToolActive,bind:this,disabled:"video"!==e,icon:"sliders-horizontal",onclick:this._toggleVideoEnhancementToolState,text:t,title:t}):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 Z("calcite-panel",{bind:this,class:I.carousel,closable:!0,closed:!e,disabled:t,heading:this.messages.imageGallery,key:this.messages.imageGallery,onCalcitePanelClose:this._toggleImageGallery},Z("div",{class:I.carouselContainer},this._renderThumbnails))}_imageGalleryToggle(){const{imageGalleryEnabled:e,invalidCameraHeading:t,visibleElements:{imageGallery:i}}=this;return i?Z("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:n,showCameraLocations:r,showMapFeatures:l,view:d,layer:c}=this;if(!c)return null;const g=c.imageGeometryField?.length?c.imageGeometryField:_,h=c.imageReferenceField?.length?c.imageReferenceField:T;t||(this._imageOverlaysLoaderTask=i((async()=>(await import("./OrientedImageryViewer/components/ImageOverlays.js")).default)));const m=this._imageOverlaysLoaderTask?.value;return m?Z(m,{closed:!n,dataCaptureEnabled:s,dataCaptureLayer:o,imageGeometryField:g,imageReferenceField:h,messages:e,overlayedLayers:a,showCameraLocations:r,showMapFeatures:l,view:d,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({[I.imageOverlaysContainer]:!0,[U.hidden]:!e||"image-loaded"!==t});return Z("div",{class:i,key:this.messages.imageOverlays},this._imageOverlaysComponent)}_imageOverlaysToggle(){const{viewModel:{state:e},imageOverlaysOpened:t,invalidCameraHeading:i,visibleElements:{imageOverlays:a}}=this;return a?Z("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,clickAction:a,state:s}=this.viewModel,o=null!=e||"default"!==i||s.includes("loading"),{messages:{end:n,next:r,previous:l,start:d}}=this;return Z(D,{afterCreate:t,clickAction:a,navigationEnabled:!o&&null!==this.navigationMode,navigationViewModel:this.viewModel,uiStrings:{end:n,next:r,previous:l,start:d},visible:!o})}get _imageViewerTriangular(){const{messages:e,triangularMeasurementActive:t}=this,{displayMessage:i,storeImageMeasurementViewer:a,mode:s,state:o,clickAction:n}=this.viewModel,r=null!=i||"default"!==s,l=this.classes({[I.viewer]:!r,[I.viewerHidden]:r});return t?Z("calcite-panel",{class:I.viewerContainerMeasurement,heading:e.measurementViewerHeading,loading:o.includes("loading")},Z("calcite-panel",{bind:this,class:l},Z(D,{afterCreate:a,clickAction:n,uiStrings:e}))):null}get _videoViewer(){const{mode:e,loadVideoViewer:t,videoViewModel:i}=this.viewModel,{control:a,reset:s}=this.messagesCommon,{mute:o,unmute:n}=this.messages,r="video"!==e,l=this.classes({[I.viewer]:!r,[I.viewerHidden]:r});return Z("calcite-panel",{bind:this,class:l},Z("div",{afterCreate:t,styles:{height:"100%"}}),Z("calcite-slider",{bind:this,labelHandles:!0,labelTicks:!0,max:i?.videoDuration,minLabel:"0",value:i?.currentTime??0,onCalciteSliderChange:this._sliderChangeHandler}),Z("calcite-action-bar",{expandDisabled:!0,layout:"horizontal"},Z("calcite-action-group",null,Z("calcite-action",{bind:this,icon:this.activeVideoIcon,onclick:()=>i?.playVideoHandler(),text:"Play",title:i?.videoPaused?a.play:a.pause})),Z("calcite-action-group",null,Z("calcite-action",{bind:this,icon:"refresh",onclick:()=>i?.rewindVideoHandler(),text:"Rewind",title:s})),Z("calcite-action-group",null,Z("calcite-action",{bind:this,icon:this.activeAudioIcon,onclick:()=>i?.toggleAudio(),text:"Audio",title:i?.videoMuted?o:n}))))}get _locationToggle(){const{viewModel:{state:e,groundCoordinates:t,groundCoordinatesAccuracy:i,triangulatedPoint:a},imageLocationToolActive:s,triangularMeasurementActive:o,messages:{groundLocation:n,triangulatedLocationHeading:r}}=this;if("image-loaded"!==e||!t||!s)return;let l=t;if(o){if(!a)return;l=a}return Z("calcite-dialog",{bind:this,dragEnabled:!0,escapeDisabled:!0,heading:o?r:n,id:n,open:!0,placement:"bottom-start",resizable:!0,scale:"s",slot:"dialogs",width:"s",onCalciteDialogBeforeClose:this._clearImageLocation},Z(G,{accuracy:i,groundCoordinates:l,messages:this.messages}))}_mapImageConversionToggle(){const{mapImageConversionToolState:e,viewModel:{state:t},invalidCameraHeading:i,visibleElements:{mapImageConversionTool:a}}=this;return a?Z("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,triangularMeasurementActive:o,visibleElements:{measurementTools:n}}=this,{state:r,mode:l}=i,{measurementTools:d,groundDistance:c,groundArea:g,heightAboveGround:h,groundLocation:m,triangulatedDistanceHeading:u,triangulatedAreaHeading:v,triangulatedLocationHeading:p}=s;return n?Z("calcite-dropdown",{disabled:a,key:"measurement-tools",maxItems:5,title:d,width:"m"},Z("calcite-action",{bind:this,disabled:"image-loaded"!==r||a,icon:e,slot:"trigger",text:d}),Z("calcite-dropdown-group",null,Z("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"measure-line",key:"distance-measurement",onclick:e=>this._toggleMeasurementSketch(e,"distance"),selected:"distance"===t&&!o},c),Z("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"measure-area",key:"area-measurement",onclick:e=>this._toggleMeasurementSketch(e,"area"),selected:"area"===t&&!o},g),Z("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},h),Z("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"pin-tear",key:"surface-location",onclick:this._toggleLocationTool,selected:!!this.imageLocationToolActive&&!o},m),"default"===l&&Z(J,null,Z("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"dual-image-distance",key:"triangular-measurement-distance",selected:!!o&&"distance"===this.measureType,onCalciteDropdownItemSelect:this._toggleTriangularDistanceMeasurements},u),Z("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"dual-image-area",key:"triangular-measurement-area",selected:!!o&&"area"===this.measureType,onCalciteDropdownItemSelect:this._toggleTriangularAreaMeasurements},v),Z("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"dual-image-location",key:"triangular-location",selected:!!o&&this.imageLocationToolActive,onCalciteDropdownItemSelect:this._toggleTriangularLocation},p)))):null}get _messageBox(){const{messages:e,viewModel:{displayMessage:t,mode:i}}=this;if(!t||"video"===i)return null;const{data:a,key:s,map:o}=t,n=`${o?K(e[s],o):e[s]}`;return Z("span",{class:I.messageBox},a?`${n} ${a}`:n)}async _loadNavigationSettings(){return this._navigationSettingsLoaderTask||(this._navigationSettingsLoaderTask=i((async()=>(await import("./OrientedImageryViewer/components/NavigationSettings.js")).default))),await this._navigationSettingsLoaderTask.promise}_navigationToolToggle(){const{state:e}=this.viewModel,{visibleElements:{navigationTool:t}}=this;return t?Z("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}=this.viewModel,{visibleElements:{directionalNavigation:t,sequentialNavigation:i}}=this,a=new N;t&&a.push(new $({active:"directional"===this.navigationMode,disabled:"image-loaded"!==e||this.invalidCameraHeading,icon:"i2DExplore",onclick:()=>{this._toggleImageNavigation("directional")},text:this.messages.directionalNavigation,title:this.messages.directionalNavigationDescription})),i&&a.push(new $({active:"sequential"===this.navigationMode,disabled:"image-loaded"!==e||this.invalidCameraHeading||!this.canNavigateSequentially,icon:"reorder-stack",onclick:()=>{this._toggleImageNavigation("sequential")},text:this.messages.sequentialNavigation,title:this.messages.sequentialNavigationDescription}));return t||i?Z(B,{actions:a,activeAction:a.items.find((e=>e.active)),icon:"absolute-direction",label:this.messages.imageNavigation,scale:"m",title:this.messages.imageNavigation}):null}_openPopupAction(){const{showPopupsAction:e}=this.visibleElements;return e?Z("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,clickAction:a,state:s}=this.viewModel,{messages:{end:o,next:n,previous:r,start:l}}=this,d=null!=e||"panoramic"!==i||s.includes("loading");return Z(v,{afterCreate:t,clickAction:a,navigationEnabled:!d&&null!==this.navigationMode,navigationViewModel:this.viewModel,uiStrings:{end:o,next:n,previous:r,start:l},visible:!d})}_activateTriangulatedImageLocationTool(){this.navigationToolActive=!0,this.imageLocationToolActive=!0}_activateTriangulatedImageLocationWorkflow(e,t){this._closeAllImageTools(),this.imageLocationToolActive=!0,this.triangularMeasurementActive=!e,this.navigationToolActive=!!t||!t}_closeImageToolsAndToggleNavigation(e,t){this._closeAllImageTools(),this.triangularMeasurementActive=!e,this.navigationToolActive=!t}_resetMeasureTypeAndActivateImageLocationTool(){this.measureType=null,this.imageLocationToolActive=!0}_closeAllImageTools(){this.imageEnhancementToolActive=!1,this.navigationToolActive=!1,this.imageOverlaysOpened=!1,this.galleryOpened=!1,this.measureType=null,this.imageLocationToolActive=!1,this.navigationMode=null,this.triangularMeasurementActive=!1,this._settingsToggle&&(this._settingsToggle.expanded=!1,this.viewModel.activeViewer?.ui.remove(this._settingsToggle))}_handleBrightnessChange(e){this.viewModel.brightness=e.currentTarget.value??0}_handleVideoBrightnessChange(e){this.viewModel.videoViewModel?.handleVideoBrightnessChange(e.target.value)}_handleContrastChange(e){this.viewModel.contrast=e.currentTarget.value??0}_handleVideoContrastChange(e){this.viewModel.videoViewModel?.handleVideoContrastChange(e.target.value)}_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"),r=a.getAttribute("data-rotation"),l=a.getAttribute("data-objectid"),d=r?parseFloat(r)%360:0,{layer:c,_galleryController:{signal:g}}=this;if(!s||!l)return;let h;try{h=E(s)?await S(c,l,{signal:g}):await O(s,{signal:g})}catch(i){n(i)||o.getLogger("esri.widgets.OrientedImageryViewer").error("#lazyLoadImage()",i)}finally{t.unobserve(a)}if(!h)return;F(h,a,d)}}))}_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,t){const{viewModel:{state:i}}=this;return"image-loaded"===i?Z(j,{icon:"exclamation-mark-triangle-f",kind:"warning",message:t,open:!0,title:e,tooltip:t}):null}get _renderNavigation(){const{viewModel:{sectorData:e,navigatorCurrentBestFeature:i,currentBestFeature:a,state:s}}=this;if(!this.container||!a)return null;let o,n,r,l,d;if(i){const{x:e,y:t,direction:a}=i,[s,c,g,h]=M[a];o=`M ${e} ${t} L ${s} ${c} A ${A[2]} ${A[2]} 0 0 1 ${g} ${h} Z`,n=e,l=t,r=M[a][4],d=M[a][5]}const c=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})},h=e=>{e.removeEventListener("click",g)},m=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})=>Z("circle",{afterRemoved:h,class:this.classes(I.feature,{selected:m===i}),cx:e,cy:t,"data-feature-index-in-sector":a,"data-sector":s,key:`${I.feature}-${i}`,onclick:g,r:b}))))),v=e=>{e.removeEventListener("click",c)},p=this.classes({[I.navigationWrapper]:!0,[I.navigationZoomed]:this._navigationToolExpanded});return this.navigationToolActive&&"image-loaded"===s?Z("div",{bind:this,class:p,key:this.messages.navigationTool},Z("svg",{afterCreate:e=>this._storeNavigationToolReference(e),class:t()?f:I.rotateWithAnimation,focusable:"false",height:C,role:"img",width:C,xmlns:"http://www.w3.org/2000/svg"},Z("defs",null,Z("linearGradient",{gradientUnits:"userSpaceOnUse",id:`${this.id}-coverage-fill`,x1:n,x2:r,y1:l,y2:d},Z("stop",{class:I.navigationPathOffset0,offset:0}),Z("stop",{class:I.navigationPathOffset1,offset:1}))),Z("g",null,Z("circle",{class:this.classes(I.sector,I.outerSector),cx:A[3],cy:A[3],onclick:this._scaleNavigationTool,r:A[3]}),Z("circle",{class:I.sector,cx:A[3],cy:A[3],r:A[2]}),Z("circle",{class:I.sector,cx:A[3],cy:A[3],r:A[1]}),Z("circle",{class:I.sector,cx:A[3],cy:A[3],r:A[0]}),Z("path",{class:I.pointer,d:"M 56.5 6.06217782649107 L 60 0 L 63.5 6.06217782649107 Z",key:`${I.pointer}-west`}),Z("path",{class:this.classes(I.pointer,I.north),d:"M 113.93782217350893 56.5 L 120 60 L 113.93782217350893 63.5 Z",key:`${I.pointer}-north`}),Z("path",{class:I.pointer,d:"M 56.5 113.93782217350893 L 60 120 L 63.5 113.93782217350893 Z",key:`${I.pointer}-east`}),Z("path",{class:I.pointer,d:"M 6.06217782649107 56.5 L 0 60 L 6.06217782649107 63.5 Z",key:`${I.pointer}-south`}),Z("path",{class:this.classes(I.sector,I.sectorSeparator),d:"M 23.937554159486076 23.937554159486076 L 96.06244584051393 96.06244584051393 M 23.937554159486076 96.06244584051393 L 96.06244584051393 23.937554159486076",key:I.sectorSeparator}),y([A[2],A[1],A[0]],A[3],A[3]).map(((t,i)=>Z("path",{afterRemoved:v,class:this.classes(I.sector,e?.[i]?.length?I.sectorEnabled:I.sectorDisabled),d:t,"data-sector":`${i}`,key:`${I.sector}-${i}`,onclick:c}))),Z("path",{class:this.classes(I.sector,I.sectorCross),d:"M 56.4 56.4 L 63.53 63.53 M 63.53 56.4 L 56.4 63.53",key:I.sectorCross}),u,a.attributes.cameraPitch>=5&&o?Z("path",{class:I.selectedFeaturePath,d:o,fill:`url(#${this.id}-coverage-fill)`,key:I.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 Z("div",{class:I.sketchTools},Z(s,{icon:a,messages:this._imageSketchToolsMessages,type:i,onAction:this._onAction}))}get _renderThumbnails(){const{currentBestFeature:e,thumbnails:t}=this.viewModel;return e?Z("div",{class:I.carouselContent},t?.items.map((({url:t,objectId:i,rotation:a},s)=>Z("div",{class:`${I.carouselItemWrapper}${e.attributes.objectId===i?"--selected":""}`,key:`${I.carouselItemWrapper}-${s}`},Z("canvas",{afterCreate:this._registerGalleryItem,afterRemoved:this._unregisterGalleryItem,alt:`thumbnail-${i}`,class:I.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}_resetVideoTools(){this.viewModel.videoViewModel?.resetVideoEnhancementTools()}_sliderChangeHandler(e){const t=this.viewModel?.videoElement?.content;t&&(t.currentTime=e.target.value,t.play())}_storeNavigationToolReference(e){this._navigationTool=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}_toggleVideoEnhancementToolState(e){e.stopPropagation(),this.videoEnhancementToolActive=!this.videoEnhancementToolActive}_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,i=this.triangularMeasurementActive&&t;this._closeAllImageTools(),this.imageLocationToolActive=i||!t,e.stopPropagation()}_toggleMeasurementSketch(e,t){e.stopPropagation();const i=this.measureType,a=this.triangularMeasurementActive;this._closeAllImageTools(),this.measureType=i!==t||a?t:null,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")}_toggleTriangularLocation(){const e=this.triangularMeasurementActive,t=this.navigationToolActive;e?null===this.measureType?this.imageLocationToolActive?this._closeImageToolsAndToggleNavigation(e,t):this._activateTriangulatedImageLocationTool():this._resetMeasureTypeAndActivateImageLocationTool():this._activateTriangulatedImageLocationWorkflow(e,t)}_toggleTriangularMeasurements(e){const t=this.triangularMeasurementActive,i=this.viewModel.measureType,a=this.navigationToolActive;t?e===i?(this._closeAllImageTools(),this.triangularMeasurementActive=!t,this.navigationToolActive=!a):(this.imageLocationToolActive=!1,this.measureType=e):(this._closeAllImageTools(),this.measureType=e,this.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(L,`${t}deg`),e.style.setProperty(k,`${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(`${Q.overlayed}-${e.id}`),this.addHandles(r((()=>e.visible),(()=>{this.viewModel.toggleOverlayMapFeatures(e.id,e.visible)})),`${Q.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(`${Q.overlayed}-${e}`),this._overlayedLayers.remove(this._overlayedLayers.find((t=>t.id===e))),this.viewModel.removeOverlayedGraphicsOnImage(e)}resetImage(){this.viewModel.resetImage()}render(){return Z("div",{class:this.classes(U.widget,V)},this._renderRoot)}async showImageByObjectId(e,t){return this.viewModel.showImageByObjectId(e,t)}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})],X.prototype,"accuracyParametersMissing",null),e([g()],X.prototype,"activeLayer",null),e([g()],X.prototype,"activeVideoIcon",null),e([g()],X.prototype,"activeAudioIcon",null),e([g()],X.prototype,"cameraHeadingThreshold",null),e([g()],X.prototype,"cameraPitchThreshold",null),e([g()],X.prototype,"canNavigateSequentially",null),e([g()],X.prototype,"currentBestFeature",null),e([g()],X.prototype,"currentCoverageVisible",null),e([g()],X.prototype,"dataCaptureEnabled",void 0),e([g()],X.prototype,"dataCaptureLayer",null),e([g()],X.prototype,"disabled",null),e([g()],X.prototype,"features",null),e([g()],X.prototype,"imagePointsInView",null),e([g()],X.prototype,"galleryOpened",void 0),e([g()],X.prototype,"icon",null),e([g()],X.prototype,"imageEnhancementToolActive",void 0),e([g()],X.prototype,"videoEnhancementToolActive",void 0),e([g({readOnly:!0})],X.prototype,"imageGalleryEnabled",null),e([g()],X.prototype,"imageLocationToolActive",null),e([g()],X.prototype,"imageOverlaysOpened",void 0),e([g({readOnly:!0})],X.prototype,"invalidCameraHeading",null),e([g()],X.prototype,"isAdditionalCoverageVisible",null),e([g()],X.prototype,"isAdditionalPointSourcesVisible",null),e([g()],X.prototype,"mapImageConversionToolState",null),e([g()],X.prototype,"measureType",null),e([g()],X.prototype,"layer",null),e([g()],X.prototype,"navigationToolActive",void 0),e([g()],X.prototype,"navigationMode",null),e([q(w()),g({type:P})],X.prototype,"viewModel",void 0),e([g(),z("esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer")],X.prototype,"messages",void 0),e([g(),z("esri/core/t9n/Units")],X.prototype,"measurementUnitMessages",void 0),e([g(),z("esri/t9n/common")],X.prototype,"messagesCommon",void 0),e([g(),z("esri/widgets/Sketch/t9n/Sketch")],X.prototype,"messagesSketch",void 0),e([g()],X.prototype,"pixelMeasurementUnit",void 0),e([g()],X.prototype,"pixelAreaMeasurementUnit",void 0),e([g({readOnly:!0})],X.prototype,"popupEnabled",null),e([g()],X.prototype,"referencePoint",null),e([g()],X.prototype,"showCameraLocations",void 0),e([g()],X.prototype,"showMapFeatures",void 0),e([q(["create","delete","redo","undo","update"]),g({readOnly:!0})],X.prototype,"sketchViewModel",null),e([g()],X.prototype,"triangularMeasurementActive",null),e([g()],X.prototype,"view",null),e([g({type:x,nonNullable:!0})],X.prototype,"visibleElements",void 0),e([g()],X.prototype,"determineWorkflowForFeature",null),e([g()],X.prototype,"updateFootprint",null),e([g()],X.prototype,"_activeMeasurementIcon",null),e([g()],X.prototype,"_activeMeasurementHeading",null),e([g()],X.prototype,"_imageOverlaysLoaderTask",void 0),e([g()],X.prototype,"_imageMeasurementToolsLoaderTask",void 0),e([g()],X.prototype,"_navigationSettingsLoaderTask",void 0),e([g()],X.prototype,"_measurementToggle",null),e([g()],X.prototype,"_renderRoot",null),e([g()],X.prototype,"_imageEnhancementTools",null),e([g()],X.prototype,"_videoEnhancementTools",null),e([g()],X.prototype,"_imageGalleryPanel",null),e([g()],X.prototype,"_imageGalleryContext",null),e([g()],X.prototype,"_imageOverlaysComponent",null),e([g()],X.prototype,"_imageOverlayMessages",null),e([g()],X.prototype,"_imageSketchToolsMessages",null),e([g()],X.prototype,"_imageViewer",null),e([g()],X.prototype,"_imageViewerTriangular",null),e([g()],X.prototype,"_videoViewer",null),e([g()],X.prototype,"_locationToggle",null),e([g()],X.prototype,"_messageBox",null),e([g()],X.prototype,"_navigationToolExpanded",void 0),e([g()],X.prototype,"_navigationTool",void 0),e([g()],X.prototype,"_panoramicViewer",null),e([g()],X.prototype,"_renderNavigation",null),e([g()],X.prototype,"_renderThumbnails",null),e([g()],X.prototype,"_sketchLoaderTask",void 0),X=e([h("esri.widgets.OrientedImageryViewer")],X);const Y=X;export{Y 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 n}from"../core/promiseUtils.js";import{watch as r,initial as l,syncAndInitial as d,whenOnce as c}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 h}from"../core/accessorSupport/decorators/subclass.js";import{or as m}from"../layers/orientedImagery/transformations/utils.js";import u from"./Expand.js";import v from"./PanoramicViewer.js";import p from"./Widget.js";import{getAllArcPath as y}from"./OrientedImageryViewer/arcUtils.js";import{getDelegatedEvents as w,defaultImageGeometryField as _,defaultOIObjectIDField as T,segmentArcs as M,featureCircleRadius as b,navigationToolDimensionLength as C,sectorsRadii as A}from"./OrientedImageryViewer/constants.js";import{css as I,navigation as f,navigationToolRotationFrom as L,navigationToolRotationTo as k,root as V}from"./OrientedImageryViewer/css.js";import{loadImageForAttachment as S,getThumbnailPixelBlock as O,isFeatureAttachment as E,renderImageWithRotation as F}from"./OrientedImageryViewer/galleryUtils.js";import P from"./OrientedImageryViewer/OrientedImageryViewerViewModel.js";import x from"./OrientedImageryViewer/OrientedImageryViewerVisibleElements.js";import{loadAlertComponents as H,Alert as j}from"./OrientedImageryViewer/components/Alert.js";import G from"./OrientedImageryViewer/components/ImageLocationWidget.js";import D from"./OrientedImageryViewer/components/ImageViewer.js";import $ from"./OrientedImageryViewer/components/NavigationAction.js";import{NavigationActionsCollection as N,NavigationActions as B}from"./OrientedImageryViewer/components/NavigationActions.js";import{NoImageLoadedError as R}from"./OrientedImageryViewer/navigation/errors.js";import{loadCalciteComponents as W}from"./support/componentsUtils.js";import{globalCss as U}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as z}from"./support/decorators/messageBundle.js";import{vmEvent as q}from"./support/decorators/vmEvent.js";import{tsx as Z,tsxFragment as J}from"./support/jsxFactory.js";import{substitute as K}from"../intl/substitute.js";const Q={overlayed:"overlayed"};let X=class extends p{constructor(e,t){super(e,t),this.dataCaptureEnabled=!1,this.galleryOpened=!1,this.imageEnhancementToolActive=!1,this.videoEnhancementToolActive=!1,this.imageOverlaysOpened=!1,this.navigationToolActive=!1,this.viewModel=new P,this.messagesCommon=null,this.messagesSketch=null,this.pixelMeasurementUnit="meters",this.pixelAreaMeasurementUnit="square-meters",this.showCameraLocations=!1,this.showMapFeatures=!1,this.visibleElements=new x,this._imageOverlaysLoaderTask=null,this._imageMeasurementToolsLoaderTask=null,this._navigationSettingsLoaderTask=null,this._clearMeasurements=()=>{this.viewModel.measureType=null,this.viewModel.clearPreviousMeasurements()},this._clearImageLocation=()=>{this.imageLocationToolActive=!1},this._navigationToolExpanded=!1,this._navigationTool=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._handleNavigationSettingsInputChange=(e,t)=>{this.set(`${e}Threshold`,t)},this._handleNavigationSettingsToggle=e=>{this.viewModel.preserveAngle=e},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(r((()=>t.visible),(()=>{this.viewModel.toggleOverlayMapFeatures(t.id,t.visible)})),`${Q.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,n="select-feature"===s,r=s!==i;switch(i){case"draw-point":case"draw-polygon":case"draw-polyline":{a&&m(n,o&&r)&&(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._settingsToggle=null,this._toggleImageNavigation=async e=>{const t=this.navigationMode;this._closeAllImageTools(),this.navigationMode=t!==e?e:null;const{activeViewer:i}=this.viewModel;if(!i)return;const{mode:a,preserveAngle:s}=this.viewModel;if("default"===a)if("directional"===this.navigationMode){const e=await this._loadNavigationSettings(),t="heading"===s||"both"===s,i="pitch"===s||"both"===s,{messages:a,messagesCommon:o}=this,n=new e({cameraHeadingThreshold:this.cameraHeadingThreshold,cameraPitchThreshold:this.cameraPitchThreshold,uiStrings:{configureNavigation:a.configureNavigation,preserveHeading:a.preserveHeading,preserveHeadingDescription:a.preserveHeadingDescription,preservePitch:a.preservePitch,preservePitchDescription:a.preservePitchDescription,settings:o.settings,thresholdLabel:a.thresholdLabel},onInputChange:this._handleNavigationSettingsInputChange,onToggle:this._handleNavigationSettingsToggle,preserveHeading:t,preservePitch:i});this._settingsToggle=new u({content:n,expandIcon:"configure"}),this.viewModel.activeViewer?.ui.add(this._settingsToggle,{position:"top-left"})}else this._settingsToggle&&(this._settingsToggle.expanded=!1,this.viewModel.activeViewer?.ui.remove(this._settingsToggle))},this._toggleImageAttributes=()=>{this.viewModel.toggleImageAttributes()},this.navigate=async e=>{let t=null;try{const{currentNode:i}=this.viewModel;if(!i)throw new R;t=await this.viewModel.navigate(i,e)}catch(i){n(i)||o.getLogger(this).error("Error occurred while navigating",i)}return t},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([r((()=>[this.viewModel?.bestFeatureAngle,this._navigationTool]),(([e,t])=>{t&&this._updateNavigationTool(t)}),l),r((()=>this.currentCoverageVisible),(e=>this._onCurrentCoverageVisibilityChange(e))),r((()=>this.isAdditionalCoverageVisible),(e=>this._onAdditionalCoverageVisibilityChange(e))),r((()=>this.isAdditionalPointSourcesVisible),(e=>this._onAdditionalCameraLocationsVisibility(e))),r((()=>({features:this.currentBestFeature,showCameraLocations:this.showCameraLocations,state:this.viewModel.state})),(({showCameraLocations:e,state:t})=>{"image-loaded"===t&&this.viewModel.overlayCameraLocations(e)}),d),r((()=>({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 c((()=>"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 Promise.all([W({"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"),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")}),H()])}destroy(){this._galleryController.abort(),this._galleryObserver.disconnect(),this.currentBestFeature=null}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 activeVideoIcon(){const{videoElement:e,videoViewModel:t}=this.viewModel;return e?.loaded&&t?t.videoPaused?"play":"pause":"play"}get activeAudioIcon(){const{videoElement:e,videoViewModel:t}=this.viewModel;return e?.loaded&&t?.videoMuted?"sound-off":"sound"}get cameraHeadingThreshold(){return this.viewModel.cameraHeadingThreshold}set cameraHeadingThreshold(e){this.viewModel.cameraHeadingThreshold=e}get cameraPitchThreshold(){return this.viewModel.cameraPitchThreshold}set cameraPitchThreshold(e){this.viewModel.cameraPitchThreshold=e}get canNavigateSequentially(){const{layer:e}=this;if(!e)return!1;const{fields:t,sequenceOrderField:i}=e;return t.some((({name:e})=>e.toLowerCase()===`${i??"sequenceorder"}`.toLowerCase()))}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 navigationMode(){return this.viewModel.navigationMode}set navigationMode(e){this.viewModel.navigationMode=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 triangularMeasurementActive(){return this.viewModel.triangularMeasurementActive}set triangularMeasurementActive(e){this.viewModel.triangularMeasurementActive=e}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 Z("calcite-action-bar",{expandDisabled:!0,layout:"horizontal",slot:"action-bar"},Z("calcite-action-group",null,this._currentFootprintToggle(),this._additionalFootprintToggle(),this._additionalPointSourcesToggle()),Z("calcite-action-group",null,this._directionToolToggle(),this._mapImageConversionToggle(),this._navigationToolToggle(),this._imageEnhancementsToggle(),this._videoEnhancementsToggle()),Z("calcite-action-group",null,this._measurementToolsToggle(),this._imageGalleryToggle(),this._imageOverlaysToggle(),this._openPopupAction()))}_renderEnhancementSlider({title:e,value:t,handleChange:i}){return Z("div",{class:I.imageEnhancementToolContainer},Z("calcite-label",null,e,Z("calcite-slider",{bind:this,labelTicks:!0,max:10,min:0,ticks:2,value:t,onCalciteSliderInput:i})))}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,triangularMeasurementActive:i}=this,{groundArea:a,heightAboveGround:s,groundDistance:o,triangulatedAreaHeading:n,triangulatedDistanceHeading:r}=t;if(i)return"area"===e?n:r;switch(e){case"area":return a;case"height":return s;default:return o}}_additionalFootprintToggle(){const{isAdditionalCoverageVisible:e,invalidCameraHeading:t,visibleElements:{additionalFootprintToggle:i}}=this;return i?Z("calcite-action",{active:e,bind:this,class:I.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?Z("calcite-action",{active:e,bind:this,class:I.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,currentBestFeatureMeasurementImage:i},triangularMeasurementActive:a,id:s}=this;if("image-loaded"!==e||!t||a&&!i)return;this._imageMeasurementToolsLoaderTask||this._loadImageMeasurementResources();const o=this._imageMeasurementToolsLoaderTask?.value;return o?Z("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},Z(o,{measurementType:t,measurementUnitMessages:this.measurementUnitMessages,messages:this.messages,oiViewModel:this.viewModel})):null}get _renderRoot(){const{viewModel:{state:e},triangularMeasurementActive:t}=this;return Z("calcite-panel",{bind:this,class:t?I.viewerContainerMeasurement:I.viewerContainer,heading:this.visibleElements.title?this.messages.title:void 0,loading:e.includes("loading")&&!t},this.visibleElements.menu?this._renderActionBar():null,Z("calcite-shell",null,Z("calcite-panel",null,this._imageViewer,this._panoramicViewer,this._videoViewer,this._messageBox,this.invalidCameraHeading?null:[this._imageGalleryPanel,this._renderNavigation,this._imageOverlaysPanel()],this._imageEnhancementTools,this._videoEnhancementTools,this._renderSketch()),this._imageViewerTriangular,this._measurementToggle,this._locationToggle,this.invalidCameraHeading?this._renderWarning(this.messages.invalidCameraHeadingWarningTitle,this.messages.invalidCameraHeadingWarningDescription):null))}_currentFootprintToggle(){const{currentCoverageVisible:e,invalidCameraHeading:t}=this,{currentFootprintToggle:i}=this.visibleElements;return i?Z("calcite-action",{active:e,bind:this,class:I.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?Z("calcite-panel",{bind:this,class:I.imageEnhancementWrapper,closable:!0,closed:!e,heading:this.messages.imageEnhancement,key:this.messages.imageEnhancement,onCalcitePanelClose:this._toggleImageEnhancementToolState},Z("div",{class:I.imageEnhancementTools},Z("div",{class:I.imageEnhancementToolContainer},Z("calcite-label",null,this.messages.brightness,Z("calcite-slider",{bind:this,labelTicks:!0,max:10,min:-10,ticks:5,value:t,onCalciteSliderInput:this._handleBrightnessChange}))),Z("div",{class:I.imageEnhancementToolContainer},Z("calcite-label",null,this.messages.contrast,Z("calcite-slider",{bind:this,labelTicks:!0,max:10,min:-10,ticks:5,value:i,onCalciteSliderInput:this._handleContrastChange}))),Z("div",{class:I.imageEnhancementToolContainer},Z("calcite-label",null,this.messages.sharpness,Z("calcite-slider",{bind:this,labelTicks:!0,max:1,min:0,step:.1,ticks:.5,value:a,onCalciteSliderInput:this._handleSharpnessChange})))),Z("calcite-action",{bind:this,icon:"reset",onclick:this._resetImageTools,slot:"header-actions-end",text:this.messagesCommon.reset,title:this.messagesCommon.reset})):null}get _videoEnhancementTools(){const{videoEnhancementToolActive:e,viewModel:{videoViewModel:t,mode:i},messages:{videoEnhancement:a,brightness:s,contrast:o},messagesCommon:{reset:n}}=this;return e&&"video"===i&&t?Z("calcite-panel",{bind:this,class:I.imageEnhancementWrapper,closable:!0,closed:!e,heading:a,key:a,onCalcitePanelClose:this._toggleVideoEnhancementToolState},Z("div",{class:I.imageEnhancementTools},this._renderEnhancementSlider({title:s,value:t.videoBrightness,handleChange:this._handleVideoBrightnessChange}),this._renderEnhancementSlider({title:o,value:t.videoContrast,handleChange:this._handleVideoContrastChange})),Z("calcite-action",{bind:this,icon:"reset",onclick:this._resetVideoTools,slot:"header-actions-end",text:n})):null}_imageEnhancementsToggle(){const{state:e,mode:t}=this.viewModel,{imageEnhancement:i}=this.visibleElements;return i&&"video"!==t?Z("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}_videoEnhancementsToggle(){const{mode:e}=this.viewModel,{videoEnhancement:t}=this.messages;return"video"===e?Z("calcite-action",{active:this.imageEnhancementToolActive,bind:this,disabled:"video"!==e,icon:"sliders-horizontal",onclick:this._toggleVideoEnhancementToolState,text:t,title:t}):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 Z("calcite-panel",{bind:this,class:I.carousel,closable:!0,closed:!e,disabled:t,heading:this.messages.imageGallery,key:this.messages.imageGallery,onCalcitePanelClose:this._toggleImageGallery},Z("div",{class:I.carouselContainer},this._renderThumbnails))}_imageGalleryToggle(){const{imageGalleryEnabled:e,invalidCameraHeading:t,visibleElements:{imageGallery:i}}=this;return i?Z("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:n,showCameraLocations:r,showMapFeatures:l,view:d,layer:c}=this;if(!c)return null;const g=c.imageGeometryField?.length?c.imageGeometryField:_,h=c.imageReferenceField?.length?c.imageReferenceField:T;t||(this._imageOverlaysLoaderTask=i((async()=>(await import("./OrientedImageryViewer/components/ImageOverlays.js")).default)));const m=this._imageOverlaysLoaderTask?.value;return m?Z(m,{closed:!n,dataCaptureEnabled:s,dataCaptureLayer:o,imageGeometryField:g,imageReferenceField:h,messages:e,overlayedLayers:a,showCameraLocations:r,showMapFeatures:l,view:d,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({[I.imageOverlaysContainer]:!0,[U.hidden]:!e||"image-loaded"!==t});return Z("div",{class:i,key:this.messages.imageOverlays},this._imageOverlaysComponent)}_imageOverlaysToggle(){const{viewModel:{state:e},imageOverlaysOpened:t,invalidCameraHeading:i,visibleElements:{imageOverlays:a}}=this;return a?Z("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,clickAction:a,state:s}=this.viewModel,o=null!=e||"default"!==i||s.includes("loading"),{messages:{end:n,next:r,previous:l,start:d}}=this;return Z(D,{afterCreate:t,clickAction:a,navigationEnabled:!o&&null!==this.navigationMode,navigationViewModel:this.viewModel,uiStrings:{end:n,next:r,previous:l,start:d},visible:!o})}get _imageViewerTriangular(){const{messages:e,triangularMeasurementActive:t}=this,{displayMessage:i,storeImageMeasurementViewer:a,mode:s,state:o,clickAction:n}=this.viewModel,r=null!=i||"default"!==s,l=this.classes({[I.viewer]:!r,[I.viewerHidden]:r});return t?Z("calcite-panel",{class:I.viewerContainerMeasurement,heading:e.measurementViewerHeading,loading:o.includes("loading")},Z("calcite-panel",{bind:this,class:l},Z(D,{afterCreate:a,clickAction:n,uiStrings:e}))):null}get _videoViewer(){const{mode:e,loadVideoViewer:t,videoViewModel:i}=this.viewModel,{control:a,reset:s}=this.messagesCommon,{mute:o,unmute:n}=this.messages,r="video"!==e,l=this.classes({[I.viewer]:!r,[I.viewerHidden]:r});return Z("calcite-panel",{bind:this,class:l},Z("div",{afterCreate:t,styles:{height:"100%"}}),Z("calcite-slider",{bind:this,labelHandles:!0,labelTicks:!0,max:i?.videoDuration,minLabel:"0",value:i?.currentTime??0,onCalciteSliderChange:this._sliderChangeHandler}),Z("calcite-action-bar",{expandDisabled:!0,layout:"horizontal"},Z("calcite-action-group",null,Z("calcite-action",{bind:this,icon:this.activeVideoIcon,onclick:()=>i?.playVideoHandler(),text:"Play",title:i?.videoPaused?a.play:a.pause})),Z("calcite-action-group",null,Z("calcite-action",{bind:this,icon:"refresh",onclick:()=>i?.rewindVideoHandler(),text:"Rewind",title:s})),Z("calcite-action-group",null,Z("calcite-action",{bind:this,icon:this.activeAudioIcon,onclick:()=>i?.toggleAudio(),text:"Audio",title:i?.videoMuted?o:n}))))}get _locationToggle(){const{viewModel:{state:e,groundCoordinates:t,groundCoordinatesAccuracy:i,triangulatedPoint:a},imageLocationToolActive:s,triangularMeasurementActive:o,messages:{groundLocation:n,triangulatedLocationHeading:r}}=this;if("image-loaded"!==e||!t||!s)return;let l=t;if(o){if(!a)return;l=a}return Z("calcite-dialog",{bind:this,dragEnabled:!0,escapeDisabled:!0,heading:o?r:n,id:n,open:!0,placement:"bottom-start",resizable:!0,scale:"s",slot:"dialogs",width:"s",onCalciteDialogBeforeClose:this._clearImageLocation},Z(G,{accuracy:i,groundCoordinates:l,messages:this.messages}))}_mapImageConversionToggle(){const{mapImageConversionToolState:e,viewModel:{state:t},invalidCameraHeading:i,visibleElements:{mapImageConversionTool:a}}=this;return a?Z("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,triangularMeasurementActive:o,visibleElements:{measurementTools:n}}=this,{state:r,mode:l}=i,{measurementTools:d,groundDistance:c,groundArea:g,heightAboveGround:h,groundLocation:m,triangulatedDistanceHeading:u,triangulatedAreaHeading:v,triangulatedLocationHeading:p}=s;return n?Z("calcite-dropdown",{disabled:a,key:"measurement-tools",maxItems:5,title:d,width:"m"},Z("calcite-action",{bind:this,disabled:"image-loaded"!==r||a,icon:e,slot:"trigger",text:d}),Z("calcite-dropdown-group",null,Z("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"measure-line",key:"distance-measurement",onclick:e=>this._toggleMeasurementSketch(e,"distance"),selected:"distance"===t&&!o},c),Z("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"measure-area",key:"area-measurement",onclick:e=>this._toggleMeasurementSketch(e,"area"),selected:"area"===t&&!o},g),Z("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},h),Z("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"pin-tear",key:"surface-location",onclick:this._toggleLocationTool,selected:!!this.imageLocationToolActive&&!o},m),"default"===l&&Z(J,null,Z("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"dual-image-distance",key:"triangular-measurement-distance",selected:!!o&&"distance"===this.measureType,onCalciteDropdownItemSelect:this._toggleTriangularDistanceMeasurements},u),Z("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"dual-image-area",key:"triangular-measurement-area",selected:!!o&&"area"===this.measureType,onCalciteDropdownItemSelect:this._toggleTriangularAreaMeasurements},v),Z("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"dual-image-location",key:"triangular-location",selected:!!o&&this.imageLocationToolActive,onCalciteDropdownItemSelect:this._toggleTriangularLocation},p)))):null}get _messageBox(){const{messages:e,viewModel:{displayMessage:t,mode:i}}=this;if(!t||"video"===i)return null;const{data:a,key:s,map:o}=t,n=`${o?K(e[s],o):e[s]}`;return Z("span",{class:I.messageBox},a?`${n} ${a}`:n)}async _loadNavigationSettings(){return this._navigationSettingsLoaderTask||(this._navigationSettingsLoaderTask=i((async()=>(await import("./OrientedImageryViewer/components/NavigationSettings.js")).default))),await this._navigationSettingsLoaderTask.promise}_navigationToolToggle(){const{state:e}=this.viewModel,{visibleElements:{navigationTool:t}}=this;return t?Z("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}=this.viewModel,{visibleElements:{directionalNavigation:t,sequentialNavigation:i}}=this,a=new N;t&&a.push(new $({active:"directional"===this.navigationMode,disabled:"image-loaded"!==e||this.invalidCameraHeading,icon:"i2DExplore",onclick:()=>{this._toggleImageNavigation("directional")},text:this.messages.directionalNavigation,title:this.messages.directionalNavigationDescription})),i&&a.push(new $({active:"sequential"===this.navigationMode,disabled:"image-loaded"!==e||this.invalidCameraHeading||!this.canNavigateSequentially,icon:"reorder-stack",onclick:()=>{this._toggleImageNavigation("sequential")},text:this.messages.sequentialNavigation,title:this.messages.sequentialNavigationDescription}));return t||i?Z(B,{actions:a,activeAction:a.items.find((e=>e.active)),icon:"absolute-direction",label:this.messages.imageNavigation,scale:"m",title:this.messages.imageNavigation}):null}_openPopupAction(){const{showPopupsAction:e}=this.visibleElements;return e?Z("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,clickAction:a,state:s}=this.viewModel,{messages:{end:o,next:n,previous:r,start:l}}=this,d=null!=e||"panoramic"!==i||s.includes("loading");return Z(v,{afterCreate:t,clickAction:a,navigationEnabled:!d&&null!==this.navigationMode,navigationViewModel:this.viewModel,uiStrings:{end:o,next:n,previous:r,start:l},visible:!d})}_activateTriangulatedImageLocationTool(){this.navigationToolActive=!0,this.imageLocationToolActive=!0}_activateTriangulatedImageLocationWorkflow(e,t){this._closeAllImageTools(),this.imageLocationToolActive=!0,this.triangularMeasurementActive=!e,this.navigationToolActive=!!t||!t}_closeImageToolsAndToggleNavigation(e,t){this._closeAllImageTools(),this.triangularMeasurementActive=!e,this.navigationToolActive=!t}_resetMeasureTypeAndActivateImageLocationTool(){this.measureType=null,this.imageLocationToolActive=!0}_closeAllImageTools(){this.imageEnhancementToolActive=!1,this.navigationToolActive=!1,this.imageOverlaysOpened=!1,this.galleryOpened=!1,this.measureType=null,this.imageLocationToolActive=!1,this.navigationMode=null,this.triangularMeasurementActive=!1,this._settingsToggle&&(this._settingsToggle.expanded=!1,this.viewModel.activeViewer?.ui.remove(this._settingsToggle))}_handleBrightnessChange(e){this.viewModel.brightness=e.currentTarget.value??0}_handleVideoBrightnessChange(e){this.viewModel.videoViewModel?.handleVideoBrightnessChange(e.target.value)}_handleContrastChange(e){this.viewModel.contrast=e.currentTarget.value??0}_handleVideoContrastChange(e){this.viewModel.videoViewModel?.handleVideoContrastChange(e.target.value)}_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"),r=a.getAttribute("data-rotation"),l=a.getAttribute("data-objectid"),d=r?parseFloat(r)%360:0,{layer:c,_galleryController:{signal:g}}=this;if(!s||!l)return;let h;try{h=E(s)?await S(c,l,{signal:g}):await O(s,{signal:g})}catch(i){n(i)||o.getLogger("esri.widgets.OrientedImageryViewer").error("#lazyLoadImage()",i)}finally{t.unobserve(a)}if(!h)return;F(h,a,d)}}))}_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,t){const{viewModel:{state:i}}=this;return"image-loaded"===i?Z(j,{icon:"exclamation-mark-triangle-f",kind:"warning",message:t,open:!0,title:e,tooltip:t}):null}get _renderNavigation(){const{viewModel:{sectorData:e,navigatorCurrentBestFeature:i,currentBestFeature:a,state:s}}=this;if(!this.container||!a)return null;let o,n,r,l,d;if(i){const{x:e,y:t,direction:a}=i,[s,c,g,h]=M[a];o=`M ${e} ${t} L ${s} ${c} A ${A[2]} ${A[2]} 0 0 1 ${g} ${h} Z`,n=e,l=t,r=M[a][4],d=M[a][5]}const c=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})},h=e=>{e.removeEventListener("click",g)},m=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})=>Z("circle",{afterRemoved:h,class:this.classes(I.feature,{selected:m===i}),cx:e,cy:t,"data-feature-index-in-sector":a,"data-sector":s,key:`${I.feature}-${i}`,onclick:g,r:b}))))),v=e=>{e.removeEventListener("click",c)},p=this.classes({[I.navigationWrapper]:!0,[I.navigationZoomed]:this._navigationToolExpanded});return this.navigationToolActive&&"image-loaded"===s?Z("div",{bind:this,class:p,key:this.messages.navigationTool},Z("svg",{afterCreate:e=>this._storeNavigationToolReference(e),class:t()?f:I.rotateWithAnimation,focusable:"false",height:C,role:"img",width:C,xmlns:"http://www.w3.org/2000/svg"},Z("defs",null,Z("linearGradient",{gradientUnits:"userSpaceOnUse",id:`${this.id}-coverage-fill`,x1:n,x2:r,y1:l,y2:d},Z("stop",{class:I.navigationPathOffset0,offset:0}),Z("stop",{class:I.navigationPathOffset1,offset:1}))),Z("g",null,Z("circle",{class:this.classes(I.sector,I.outerSector),cx:A[3],cy:A[3],onclick:this._scaleNavigationTool,r:A[3]}),Z("circle",{class:I.sector,cx:A[3],cy:A[3],r:A[2]}),Z("circle",{class:I.sector,cx:A[3],cy:A[3],r:A[1]}),Z("circle",{class:I.sector,cx:A[3],cy:A[3],r:A[0]}),Z("path",{class:I.pointer,d:"M 56.5 6.06217782649107 L 60 0 L 63.5 6.06217782649107 Z",key:`${I.pointer}-west`}),Z("path",{class:this.classes(I.pointer,I.north),d:"M 113.93782217350893 56.5 L 120 60 L 113.93782217350893 63.5 Z",key:`${I.pointer}-north`}),Z("path",{class:I.pointer,d:"M 56.5 113.93782217350893 L 60 120 L 63.5 113.93782217350893 Z",key:`${I.pointer}-east`}),Z("path",{class:I.pointer,d:"M 6.06217782649107 56.5 L 0 60 L 6.06217782649107 63.5 Z",key:`${I.pointer}-south`}),Z("path",{class:this.classes(I.sector,I.sectorSeparator),d:"M 23.937554159486076 23.937554159486076 L 96.06244584051393 96.06244584051393 M 23.937554159486076 96.06244584051393 L 96.06244584051393 23.937554159486076",key:I.sectorSeparator}),y([A[2],A[1],A[0]],A[3],A[3]).map(((t,i)=>Z("path",{afterRemoved:v,class:this.classes(I.sector,e?.[i]?.length?I.sectorEnabled:I.sectorDisabled),d:t,"data-sector":`${i}`,key:`${I.sector}-${i}`,onclick:c}))),Z("path",{class:this.classes(I.sector,I.sectorCross),d:"M 56.4 56.4 L 63.53 63.53 M 63.53 56.4 L 56.4 63.53",key:I.sectorCross}),u,a.attributes.cameraPitch>=5&&o?Z("path",{class:I.selectedFeaturePath,d:o,fill:`url(#${this.id}-coverage-fill)`,key:I.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 Z("div",{class:I.sketchTools},Z(s,{icon:a,messages:this._imageSketchToolsMessages,type:i,onAction:this._onAction}))}get _renderThumbnails(){const{currentBestFeature:e,thumbnails:t}=this.viewModel;return e?Z("div",{class:I.carouselContent},t?.items.map((({url:t,objectId:i,rotation:a},s)=>Z("div",{class:`${I.carouselItemWrapper}${e.attributes.objectId===i?"--selected":""}`,key:`${I.carouselItemWrapper}-${s}`},Z("canvas",{afterCreate:this._registerGalleryItem,afterRemoved:this._unregisterGalleryItem,alt:`thumbnail-${i}`,class:I.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}_resetVideoTools(){this.viewModel.videoViewModel?.resetVideoEnhancementTools()}_sliderChangeHandler(e){const t=this.viewModel?.videoElement?.content;t&&(t.currentTime=e.target.value,t.play())}_storeNavigationToolReference(e){this._navigationTool=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}_toggleVideoEnhancementToolState(e){e.stopPropagation(),this.videoEnhancementToolActive=!this.videoEnhancementToolActive}_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,i=this.triangularMeasurementActive&&t;this._closeAllImageTools(),this.imageLocationToolActive=i||!t,e.stopPropagation()}_toggleMeasurementSketch(e,t){e.stopPropagation();const i=this.measureType,a=this.triangularMeasurementActive;this._closeAllImageTools(),this.measureType=i!==t||a?t:null,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")}_toggleTriangularLocation(){const e=this.triangularMeasurementActive,t=this.navigationToolActive;e?null===this.measureType?this.imageLocationToolActive?this._closeImageToolsAndToggleNavigation(e,t):this._activateTriangulatedImageLocationTool():this._resetMeasureTypeAndActivateImageLocationTool():this._activateTriangulatedImageLocationWorkflow(e,t)}_toggleTriangularMeasurements(e){const t=this.triangularMeasurementActive,i=this.viewModel.measureType,a=this.navigationToolActive;t?e===i?(this._closeAllImageTools(),this.triangularMeasurementActive=!t,this.navigationToolActive=!a):(this.imageLocationToolActive=!1,this.measureType=e):(this._closeAllImageTools(),this.measureType=e,this.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(L,`${t}deg`),e.style.setProperty(k,`${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(`${Q.overlayed}-${e.id}`),this.addHandles(r((()=>e.visible),(()=>{this.viewModel.toggleOverlayMapFeatures(e.id,e.visible)})),`${Q.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(`${Q.overlayed}-${e}`),this._overlayedLayers.remove(this._overlayedLayers.find((t=>t.id===e))),this.viewModel.removeOverlayedGraphicsOnImage(e)}resetImage(){this.viewModel.resetImage()}render(){return Z("div",{class:this.classes(U.widget,V)},this._renderRoot)}async showImageByObjectId(e,t){return this.viewModel.showImageByObjectId(e,t)}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})],X.prototype,"accuracyParametersMissing",null),e([g()],X.prototype,"activeLayer",null),e([g()],X.prototype,"activeVideoIcon",null),e([g()],X.prototype,"activeAudioIcon",null),e([g()],X.prototype,"cameraHeadingThreshold",null),e([g()],X.prototype,"cameraPitchThreshold",null),e([g()],X.prototype,"canNavigateSequentially",null),e([g()],X.prototype,"currentBestFeature",null),e([g()],X.prototype,"currentCoverageVisible",null),e([g()],X.prototype,"dataCaptureEnabled",void 0),e([g()],X.prototype,"dataCaptureLayer",null),e([g()],X.prototype,"disabled",null),e([g()],X.prototype,"features",null),e([g()],X.prototype,"imagePointsInView",null),e([g()],X.prototype,"galleryOpened",void 0),e([g()],X.prototype,"icon",null),e([g()],X.prototype,"imageEnhancementToolActive",void 0),e([g()],X.prototype,"videoEnhancementToolActive",void 0),e([g({readOnly:!0})],X.prototype,"imageGalleryEnabled",null),e([g()],X.prototype,"imageLocationToolActive",null),e([g()],X.prototype,"imageOverlaysOpened",void 0),e([g({readOnly:!0})],X.prototype,"invalidCameraHeading",null),e([g()],X.prototype,"isAdditionalCoverageVisible",null),e([g()],X.prototype,"isAdditionalPointSourcesVisible",null),e([g()],X.prototype,"mapImageConversionToolState",null),e([g()],X.prototype,"measureType",null),e([g()],X.prototype,"layer",null),e([g()],X.prototype,"navigationToolActive",void 0),e([g()],X.prototype,"navigationMode",null),e([q(w()),g({type:P})],X.prototype,"viewModel",void 0),e([g(),z("esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer")],X.prototype,"messages",void 0),e([g(),z("esri/core/t9n/Units")],X.prototype,"measurementUnitMessages",void 0),e([g(),z("esri/t9n/common")],X.prototype,"messagesCommon",void 0),e([g(),z("esri/widgets/Sketch/t9n/Sketch")],X.prototype,"messagesSketch",void 0),e([g()],X.prototype,"pixelMeasurementUnit",void 0),e([g()],X.prototype,"pixelAreaMeasurementUnit",void 0),e([g({readOnly:!0})],X.prototype,"popupEnabled",null),e([g()],X.prototype,"referencePoint",null),e([g()],X.prototype,"showCameraLocations",void 0),e([g()],X.prototype,"showMapFeatures",void 0),e([q(["create","delete","redo","undo","update"]),g({readOnly:!0})],X.prototype,"sketchViewModel",null),e([g()],X.prototype,"triangularMeasurementActive",null),e([g()],X.prototype,"view",null),e([g({type:x,nonNullable:!0})],X.prototype,"visibleElements",void 0),e([g()],X.prototype,"determineWorkflowForFeature",null),e([g()],X.prototype,"updateFootprint",null),e([g()],X.prototype,"_activeMeasurementIcon",null),e([g()],X.prototype,"_activeMeasurementHeading",null),e([g()],X.prototype,"_imageOverlaysLoaderTask",void 0),e([g()],X.prototype,"_imageMeasurementToolsLoaderTask",void 0),e([g()],X.prototype,"_navigationSettingsLoaderTask",void 0),e([g()],X.prototype,"_measurementToggle",null),e([g()],X.prototype,"_renderRoot",null),e([g()],X.prototype,"_imageEnhancementTools",null),e([g()],X.prototype,"_videoEnhancementTools",null),e([g()],X.prototype,"_imageGalleryPanel",null),e([g()],X.prototype,"_imageGalleryContext",null),e([g()],X.prototype,"_imageOverlaysComponent",null),e([g()],X.prototype,"_imageOverlayMessages",null),e([g()],X.prototype,"_imageSketchToolsMessages",null),e([g()],X.prototype,"_imageViewer",null),e([g()],X.prototype,"_imageViewerTriangular",null),e([g()],X.prototype,"_videoViewer",null),e([g()],X.prototype,"_locationToggle",null),e([g()],X.prototype,"_messageBox",null),e([g()],X.prototype,"_navigationToolExpanded",void 0),e([g()],X.prototype,"_navigationTool",void 0),e([g()],X.prototype,"_panoramicViewer",null),e([g()],X.prototype,"_renderNavigation",null),e([g()],X.prototype,"_renderThumbnails",null),e([g()],X.prototype,"_sketchLoaderTask",void 0),X=e([h("esri.widgets.OrientedImageryViewer")],X);const Y=X;export{Y 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 i from"../../Camera.js";import t from"../../Ground.js";import a from"../../Map.js";import o from"../../request.js";import r from"../../core/Collection.js";import s from"../../core/Error.js";import n from"../../core/Evented.js";import{JSONMap as h}from"../../core/jsonMap.js";import{rad2deg as m,deg2rad as l}from"../../core/mathUtils.js";import{destroyMaybe as d}from"../../core/maybe.js";import{isAbortError as c,waitTick as p}from"../../core/promiseUtils.js";import{watch as g,syncAndInitial as _,when as u}from"../../core/reactiveUtils.js";import{property as v}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{enumeration as y}from"../../core/accessorSupport/decorators/enumeration.js";import{subclass as f}from"../../core/accessorSupport/decorators/subclass.js";import w from"../../geometry/SpatialReference.js";import M from"../../layers/GraphicsLayer.js";import{convertSphereVertexToPixelLocation as V}from"../../layers/orientedImagery/transformations/utils.js";import z from"../../views/SceneView.js";import{logAndThrow as R,getMissingPropertyErrorName as C,getMissingPropertyErrorMessage as j}from"../OrientedImageryViewer/utils.js";import{defaultImageSphereCenter as P,maxPanoramicViewerHFOV as H,minPanoramicViewerHFOV as O,humanBinocularHFOV as S}from"./constants.js";import b from"./PanoramicZoomConditions.js";import I from"./PanoramicZoomViewModel.js";import{findDiagonalFOV as k,meshToGraphic as x,createImageSphere as G}from"./utils.js";const F={default:"default",navigation:"navigation",fovConstraint:"fov-constraint",clickAction:"image-click-action"};let A=class extends n.EventedAccessor{constructor(e){super(e),this._startPosition=null,this._targetPosition=null,this._graphics=new M({elevationInfo:{mode:"relative-to-ground"}}),this._imageGraphic=null,this._loadController=null,this._map=new a({ground:new t({opacity:0,navigationConstraint:null}),layers:new r([this._graphics])}),this._zoomViewModel=null,this.autoLoad=!1,this.clickAction="none",this.imageSize=null,this.imageSource=null,this.navigationManager=null,this.navigationViewModel=null,this.pitch=90,this.state="ready",this.yaw=0,this._addNavigationHandles=()=>{this.imageRenderer.basemapTerrain.suspended=!0,this.imageRenderer.constraints.tilt.max=180,this.removeHandles(F.navigation),this.addHandles([this.imageRenderer.on("mouse-wheel",this._handleWheel),this.imageRenderer.on("double-click",this._handleDoubleClick),this.imageRenderer.on("drag",this._handleDrag),this.imageRenderer.on("key-down",(e=>{const i=["+","-","Shift","_","=","ArrowUp","ArrowDown","ArrowRight","ArrowLeft"],t=e.key;i.includes(t)&&e.stopPropagation()}))],F.navigation)},this._addHFOVHandles=()=>{this.removeHandles(F.fovConstraint),this.addHandles(g((()=>[this.maxHFOV,this.minHFOV]),(()=>{this._zoomViewModel&&(this._zoomViewModel.panoramicZoomConditions=new b({view:this.imageRenderer,maxFOV:this.maxHFOV,minFOV:this.minHFOV}))}),_),F.fovConstraint)},this._addZoomHandles=()=>{this._zoomViewModel=new I({view:this.imageRenderer,panoramicZoomConditions:new b({maxFOV:this.maxHFOV,minFOV:this.minHFOV})});const e=this.imageRenderer.ui.find("zoom");e&&(e.viewModel=this._zoomViewModel),this._addHFOVHandles()},this._cancelLoadWithController=()=>{this._loadController?.abort(),this._loadController=null},this._handleDoubleClick=e=>{e.stopPropagation(),e.native.ctrlKey?this._zoomOut():this._zoomIn()},this._handleDrag=e=>{e.stopPropagation();const{action:i,x:t,y:a}=e;switch(i){case"start":this._startPosition=this._targetPosition={x:t,y:a};break;case"update":this._targetPosition={x:t,y:a},this._updateCameraHeadingAndTilt()}},this._handleImageClick=e=>{if("image-loaded"===this.state&&this.imageRenderer.ready)switch(this.clickAction){case"emit":e.stopPropagation(),this.emit("click",e);break;case"hittest":e.stopPropagation(),e.defer((async()=>{const i=await this.imageRenderer.hitTest(e.screenPoint,{include:this._graphics});i.results=i.results.filter((e=>"graphic"===e.type&&e.graphic!==this._imageGraphic)),this.emit("hittest-response",i)}));break;case"pixel-location":{if(e.stopPropagation(),!this.imageSize||!e.mapPoint)return void this.emit("pixel-location",null);const i=V(e.mapPoint,this.imageSize[0],this.imageSize[1]);this.emit("pixel-location",{...i,spatialReference:w.WebMercator});break}}},this._handleWheel=e=>{const i=e.deltaX??e.native.deltaX;e.stopPropagation(),i>0||e.deltaY>0?this._zoomOut():this._zoomIn()},this._loadNavigationManager=async()=>{if(!this.navigationManager||this.navigationManager?.destroyed){const e=await import("../OrientedImageryViewer/navigation/NavigationManagerPanoramic.js").then((e=>e.default));this.navigationManager=new e({viewModel:this.navigationViewModel})}return this.navigationManager},this._loadWithController=()=>{this._cancelLoadWithController(),this._loadController=new AbortController,this.loadImage(this._loadController)},this._zoomIn=()=>this._zoomViewModel?.zoomIn(),this._zoomOut=()=>this._zoomViewModel?.zoomOut(),this.addGraphic=(e,i)=>"image-loaded"===this.state&&!this._graphics.graphics.includes(e)&&(this._graphics.graphics.add(e,i),!0),this.addManyGraphics=e=>{if("image-loaded"!==this.state)return!1;const i=e.filter((e=>!this._graphics.graphics.includes(e)));return this._graphics.graphics.addMany(i),!0},this.clearGraphics=()=>{this._graphics.graphics.removeAll()},this.clearImage=()=>{this.imageSize=null,this._removeImageSphere()},this.navigate=async(e,i)=>(await this._loadNavigationManager()).navigate(e,i),this.removeGraphic=e=>!("image-loaded"!==this.state||!this._graphics.graphics.includes(e))&&(this._graphics.remove(e),!0),this.removeManyGraphics=e=>{if("image-loaded"!==this.state)return!1;const i=e.filter((e=>this._graphics.graphics.includes(e)));return this._graphics.removeMany(i),!0},this._imageRenderer=new z({map:this._map,viewingMode:"local",camera:{position:P},environment:{atmosphereEnabled:!1,starsEnabled:!1,lighting:{type:"virtual"}},popupEnabled:!1,spatialReference:w.WebMercator,ui:{components:["zoom"]}})}destroy(){this._imageRenderer.destroy()}initialize(){this.state="initialized",this.addHandles([g((()=>this.imageSource),(()=>{this.imageSource&&this.autoLoad&&this._loadWithController()}),_),g((()=>this.fov),(()=>{this._reloadCamera()}),_),g((()=>this.yaw),(e=>{this.camera.heading=e,this._reloadCamera()}),_),g((()=>this.pitch),(e=>{this.camera.tilt=e,this._reloadCamera()}),_),u((()=>this.imageRenderer.ready),(()=>{this._addNavigationHandles(),this._addZoomHandles()}),_),g((()=>this.clickAction),(e=>{this.removeHandles(F.clickAction),"none"!==e&&this.addHandles(this.imageRenderer.on("click",this._handleImageClick))}),_)],F.default)}get camera(){return this.imageRenderer.camera}set camera(e){e&&(this.imageRenderer.camera=e.clone())}get fov(){return this.camera.fov}set fov(e){Number.isFinite(e)&&this._zoomViewModel?.zoomTo(e)}get hfov(){const{fov:e}=this.camera,{size:[i,t]}=this.imageRenderer,a=i/t,o=Math.atan(a);return 2*m(Math.atan(Math.tan(l(e/2))*Math.sin(o)))}get imageRenderer(){return this._imageRenderer}get maxHFOV(){const{size:[e,i]}=this.imageRenderer;return k(H,e/i)}get minHFOV(){const{size:[e,i]}=this.imageRenderer;return k(O,e/i)}get vfov(){const{fov:e}=this.camera,{size:[i,t]}=this.imageRenderer,a=i/t,o=Math.atan(a);return 2*m(Math.atan(Math.tan(l(e/2))*Math.cos(o)))}async _loadImageInternal(e,i){let t;this.state="image-loading";try{t=(await o(e,{responseType:"image",...i})).data}catch(a){throw c(a)?this.state="image-load-aborted":this.state="image-load-error",a}return this._updateImageSphere(t,i)}_reloadCamera(){this.camera=this.camera.clone()}_removeImageSphere(){this._imageGraphic&&(this._graphics.remove(this._imageGraphic),this._imageGraphic=d(this._imageGraphic)),this.state="ready",this.imageSize=null}_updateCameraHeadingAndTilt(){if(!this._startPosition||!this._targetPosition)return;const e=this.camera.heading+(this._startPosition.x-this._targetPosition.x)/this.imageRenderer.width*this.camera.fov;this.yaw=(e+360)%360;const i=this.camera.tilt-(this._startPosition.y-this._targetPosition.y)/this.imageRenderer.height*this.imageRenderer.camera.tilt;this.pitch=Math.min(179.5,Math.max(.5,i)),this._startPosition=this._targetPosition}async _updateImageSphere(e,i){await p(i);const{size:[t,a]}=this.imageRenderer;return this._imageGraphic=x(G(e)),this._graphics.add(this._imageGraphic),this.fov=k(S,t/a),this.state="image-loaded",this.imageSize=[e.width,e.height],this._imageGraphic.geometry}async loadImage(e){return this._removeImageSphere(),this.imageSource?this._loadImageInternal(this.imageSource,e):R(this.declaredClass,new s(C("panoramic-viewer"),j("PanoramicViewerViewModel","imageSource")))}};e([v()],A.prototype,"_graphics",void 0),e([v()],A.prototype,"_imageGraphic",void 0),e([v()],A.prototype,"_imageRenderer",void 0),e([v()],A.prototype,"_loadController",void 0),e([v()],A.prototype,"_map",void 0),e([v()],A.prototype,"_zoomViewModel",void 0),e([v({type:Boolean})],A.prototype,"autoLoad",void 0),e([v({type:i})],A.prototype,"camera",null),e([y(new h({emit:"emit",hittest:"hittest",none:"none","pixel-location":"pixel-location"}))],A.prototype,"clickAction",void 0),e([v({type:Number})],A.prototype,"fov",null),e([v({readOnly:!0})],A.prototype,"hfov",null),e([v({readOnly:!0})],A.prototype,"imageRenderer",null),e([v()],A.prototype,"imageSize",void 0),e([v()],A.prototype,"imageSource",void 0),e([v({readOnly:!0})],A.prototype,"maxHFOV",null),e([v({readOnly:!0})],A.prototype,"minHFOV",null),e([v()],A.prototype,"navigationViewModel",void 0),e([v({type:Number})],A.prototype,"pitch",void 0),e([v()],A.prototype,"state",void 0),e([v({readOnly:!0})],A.prototype,"vfov",null),e([v({type:Number})],A.prototype,"yaw",void 0),A=e([f("esri.widgets.PanoramicViewer.PanoramicViewerViewModel")],A);const L=A;export{L as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import i from"../../Camera.js";import t from"../../Ground.js";import a from"../../Map.js";import o from"../../request.js";import r from"../../core/Collection.js";import s from"../../core/Error.js";import n from"../../core/Evented.js";import{JSONMap as h}from"../../core/jsonMap.js";import{rad2deg as m,deg2rad as l}from"../../core/mathUtils.js";import{destroyMaybe as d}from"../../core/maybe.js";import{isAbortError as c,waitTick as p}from"../../core/promiseUtils.js";import{watch as g,syncAndInitial as _,when as u}from"../../core/reactiveUtils.js";import{property as v}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{enumeration as y}from"../../core/accessorSupport/decorators/enumeration.js";import{subclass as f}from"../../core/accessorSupport/decorators/subclass.js";import w from"../../geometry/SpatialReference.js";import M from"../../layers/GraphicsLayer.js";import{convertSphereVertexToPixelLocation as V}from"../../layers/orientedImagery/transformations/utils.js";import z from"../../views/SceneView.js";import{logAndThrow as R,getMissingPropertyErrorName as C,getMissingPropertyErrorMessage as j}from"../OrientedImageryViewer/utils.js";import{defaultImageSphereCenter as P,maxPanoramicViewerHFOV as H,minPanoramicViewerHFOV as O,humanBinocularHFOV as S}from"./constants.js";import b from"./PanoramicZoomConditions.js";import I from"./PanoramicZoomViewModel.js";import{findDiagonalFOV as k,meshToGraphic as x,createImageSphere as G}from"./utils.js";const F={default:"default",navigation:"navigation",fovConstraint:"fov-constraint",clickAction:"image-click-action"};let A=class extends n.EventedAccessor{constructor(e){super(e),this._startPosition=null,this._targetPosition=null,this._graphics=new M({elevationInfo:{mode:"relative-to-ground"}}),this._imageGraphic=null,this._loadController=null,this._map=new a({ground:new t({opacity:0,navigationConstraint:null}),layers:new r([this._graphics])}),this._zoomViewModel=null,this.autoLoad=!1,this.clickAction="none",this.imageSize=null,this.imageSource=null,this.navigationManager=null,this.navigationViewModel=null,this.pitch=90,this.state="ready",this.yaw=0,this._addNavigationHandles=()=>{this.imageRenderer.basemapTerrain.suspended=!0,this.imageRenderer.constraints.tilt.max=180,this.removeHandles(F.navigation),this.addHandles([this.imageRenderer.on("mouse-wheel",this._handleWheel),this.imageRenderer.on("double-click",this._handleDoubleClick),this.imageRenderer.on("drag",this._handleDrag),this.imageRenderer.on("key-down",(e=>{const i=["+","-","Shift","_","=","ArrowUp","ArrowDown","ArrowRight","ArrowLeft"],t=e.key;i.includes(t)&&e.stopPropagation()}))],F.navigation)},this._addHFOVHandles=()=>{this.removeHandles(F.fovConstraint),this.addHandles(g((()=>[this.maxHFOV,this.minHFOV]),(()=>{this._zoomViewModel&&(this._zoomViewModel.panoramicZoomConditions=new b({view:this.imageRenderer,maxFOV:this.maxHFOV,minFOV:this.minHFOV}))}),_),F.fovConstraint)},this._addZoomHandles=()=>{this._zoomViewModel=new I({view:this.imageRenderer,panoramicZoomConditions:new b({maxFOV:this.maxHFOV,minFOV:this.minHFOV})});const e=this.imageRenderer.ui.find("zoom");e&&(e.viewModel=this._zoomViewModel),this._addHFOVHandles()},this._cancelLoadWithController=()=>{this._loadController?.abort(),this._loadController=null},this._handleDoubleClick=e=>{e.stopPropagation(),e.native.ctrlKey?this._zoomOut():this._zoomIn()},this._handleDrag=e=>{e.stopPropagation();const{action:i,x:t,y:a}=e;switch(i){case"start":this._startPosition=this._targetPosition={x:t,y:a};break;case"update":this._targetPosition={x:t,y:a},this._updateCameraHeadingAndTilt()}},this._handleImageClick=e=>{if("image-loaded"===this.state&&this.imageRenderer.ready)switch(this.clickAction){case"emit":e.stopPropagation(),this.emit("click",e);break;case"hittest":e.stopPropagation(),e.defer((async()=>{const i=await this.imageRenderer.hitTest(e.screenPoint,{include:this._graphics});i.results=i.results.filter((e=>"graphic"===e.type&&e.graphic!==this._imageGraphic)),this.emit("hittest-response",i)}));break;case"pixel-location":{if(e.stopPropagation(),!this.imageSize||!e.mapPoint)return void this.emit("pixel-location",null);const i=V(e.mapPoint,this.imageSize[0],this.imageSize[1]);this.emit("pixel-location",{...i,spatialReference:w.WebMercator});break}}},this._handleWheel=e=>{const i=e.deltaX??e.native.deltaX;e.stopPropagation(),i>0||e.deltaY>0?this._zoomOut():this._zoomIn()},this._loadNavigationManager=async()=>{if(!this.navigationManager||this.navigationManager?.destroyed){const e=await import("../OrientedImageryViewer/navigation/NavigationManagerPanoramic.js").then((e=>e.default));this.navigationManager=new e({viewModel:this.navigationViewModel})}return this.navigationManager},this._loadWithController=()=>{this._cancelLoadWithController(),this._loadController=new AbortController,this.loadImage(this._loadController)},this._zoomIn=()=>this._zoomViewModel?.zoomIn(),this._zoomOut=()=>this._zoomViewModel?.zoomOut(),this.addGraphic=(e,i)=>"image-loaded"===this.state&&!this._graphics.graphics.includes(e)&&(this._graphics.graphics.add(e,i),!0),this.addManyGraphics=e=>{if("image-loaded"!==this.state)return!1;const i=e.filter((e=>!this._graphics.graphics.includes(e)));return this._graphics.graphics.addMany(i),!0},this.clearGraphics=()=>{this._graphics.graphics.removeAll()},this.clearImage=()=>{this.imageSize=null,this._removeImageSphere()},this.navigate=async(e,i)=>{const t=this._loadNavigationManager();this.navigationViewModel?.addUpdatingPromise(t);const a=await t;return await a.navigate(e,i)},this.removeGraphic=e=>!("image-loaded"!==this.state||!this._graphics.graphics.includes(e))&&(this._graphics.remove(e),!0),this.removeManyGraphics=e=>{if("image-loaded"!==this.state)return!1;const i=e.filter((e=>this._graphics.graphics.includes(e)));return this._graphics.removeMany(i),!0},this._imageRenderer=new z({map:this._map,viewingMode:"local",camera:{position:P},environment:{atmosphereEnabled:!1,starsEnabled:!1,lighting:{type:"virtual"}},popupEnabled:!1,spatialReference:w.WebMercator,ui:{components:["zoom"]}})}destroy(){this._imageRenderer.destroy()}initialize(){this.state="initialized",this.addHandles([g((()=>this.imageSource),(()=>{this.imageSource&&this.autoLoad&&this._loadWithController()}),_),g((()=>this.fov),(()=>{this._reloadCamera()}),_),g((()=>this.yaw),(e=>{this.camera.heading=e,this._reloadCamera()}),_),g((()=>this.pitch),(e=>{this.camera.tilt=e,this._reloadCamera()}),_),u((()=>this.imageRenderer.ready),(()=>{this._addNavigationHandles(),this._addZoomHandles()}),_),g((()=>this.clickAction),(e=>{this.removeHandles(F.clickAction),"none"!==e&&this.addHandles(this.imageRenderer.on("click",this._handleImageClick))}),_)],F.default)}get camera(){return this.imageRenderer.camera}set camera(e){e&&(this.imageRenderer.camera=e.clone())}get fov(){return this.camera.fov}set fov(e){Number.isFinite(e)&&this._zoomViewModel?.zoomTo(e)}get hfov(){const{fov:e}=this.camera,{size:[i,t]}=this.imageRenderer,a=i/t,o=Math.atan(a);return 2*m(Math.atan(Math.tan(l(e/2))*Math.sin(o)))}get imageRenderer(){return this._imageRenderer}get maxHFOV(){const{size:[e,i]}=this.imageRenderer;return k(H,e/i)}get minHFOV(){const{size:[e,i]}=this.imageRenderer;return k(O,e/i)}get vfov(){const{fov:e}=this.camera,{size:[i,t]}=this.imageRenderer,a=i/t,o=Math.atan(a);return 2*m(Math.atan(Math.tan(l(e/2))*Math.cos(o)))}async _loadImageInternal(e,i){let t;this.state="image-loading";try{t=(await o(e,{responseType:"image",...i})).data}catch(a){throw c(a)?this.state="image-load-aborted":this.state="image-load-error",a}return this._updateImageSphere(t,i)}_reloadCamera(){this.camera=this.camera.clone()}_removeImageSphere(){this._imageGraphic&&(this._graphics.remove(this._imageGraphic),this._imageGraphic=d(this._imageGraphic)),this.state="ready",this.imageSize=null}_updateCameraHeadingAndTilt(){if(!this._startPosition||!this._targetPosition)return;const e=this.camera.heading+(this._startPosition.x-this._targetPosition.x)/this.imageRenderer.width*this.camera.fov;this.yaw=(e+360)%360;const i=this.camera.tilt-(this._startPosition.y-this._targetPosition.y)/this.imageRenderer.height*this.imageRenderer.camera.tilt;this.pitch=Math.min(179.5,Math.max(.5,i)),this._startPosition=this._targetPosition}async _updateImageSphere(e,i){await p(i);const{size:[t,a]}=this.imageRenderer;return this._imageGraphic=x(G(e)),this._graphics.add(this._imageGraphic),this.fov=k(S,t/a),this.state="image-loaded",this.imageSize=[e.width,e.height],this._imageGraphic.geometry}async loadImage(e){return this._removeImageSphere(),this.imageSource?this._loadImageInternal(this.imageSource,e):R(this.declaredClass,new s(C("panoramic-viewer"),j("PanoramicViewerViewModel","imageSource")))}};e([v()],A.prototype,"_graphics",void 0),e([v()],A.prototype,"_imageGraphic",void 0),e([v()],A.prototype,"_imageRenderer",void 0),e([v()],A.prototype,"_loadController",void 0),e([v()],A.prototype,"_map",void 0),e([v()],A.prototype,"_zoomViewModel",void 0),e([v({type:Boolean})],A.prototype,"autoLoad",void 0),e([v({type:i})],A.prototype,"camera",null),e([y(new h({emit:"emit",hittest:"hittest",none:"none","pixel-location":"pixel-location"}))],A.prototype,"clickAction",void 0),e([v({type:Number})],A.prototype,"fov",null),e([v({readOnly:!0})],A.prototype,"hfov",null),e([v({readOnly:!0})],A.prototype,"imageRenderer",null),e([v()],A.prototype,"imageSize",void 0),e([v()],A.prototype,"imageSource",void 0),e([v({readOnly:!0})],A.prototype,"maxHFOV",null),e([v({readOnly:!0})],A.prototype,"minHFOV",null),e([v()],A.prototype,"navigationViewModel",void 0),e([v({type:Number})],A.prototype,"pitch",void 0),e([v()],A.prototype,"state",void 0),e([v({readOnly:!0})],A.prototype,"vfov",null),e([v({type:Number})],A.prototype,"yaw",void 0),A=e([f("esri.widgets.PanoramicViewer.PanoramicViewerViewModel")],A);const L=A;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 t from"../Camera.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import r from"./Widget.js";import a from"./OrientedImageryViewer/components/NavigationUI360.js";import{loadSequentialNavigationUIComponents as n,SequentialNavigationUI as s}from"./OrientedImageryViewer/components/SequentialNavigationUI.js";import l from"./PanoramicViewer/PanoramicViewerViewModel.js";import{loadCalciteComponents as p}from"./support/componentsUtils.js";import{globalCss as c}from"./support/globalCss.js";import"./support/widgetUtils.js";import{vmEvent as d}from"./support/decorators/vmEvent.js";import{tsx as u}from"./support/jsxFactory.js";const v="esri-panoramic-viewer";let h=class extends r{constructor(e){super(e),this.navigationEnabled=!1,this.uiStrings=null,this.viewModel=new l,this._afterContainerCreate=e=>{this.imageRenderer.container=e},this.addGraphic=(e,t)=>{this.viewModel.addGraphic(e,t)},this.addManyGraphics=e=>{this.viewModel.addManyGraphics(e)},this.clearGraphics=()=>{this.viewModel.clearGraphics()},this.clearImage=()=>{this.viewModel.clearImage()},this.loadImage=e=>this.viewModel.loadImage(e),this.navigate=async(e,t)=>this.viewModel.navigate(e,t),this.removeGraphic=e=>{this.viewModel.removeGraphic(e)},this.removeManyGraphics=e=>{this.viewModel.removeManyGraphics(e)}}loadDependencies(){return Promise.all([p({panel:()=>import("@esri/calcite-components/dist/components/calcite-panel")}),n()])}get autoLoad(){return this.viewModel.autoLoad}set autoLoad(e){this.viewModel.autoLoad=e}get camera(){return this.viewModel.camera}set camera(e){e&&(this.viewModel.camera=e)}get clickAction(){return this.viewModel.clickAction}set clickAction(e){this.viewModel.clickAction=e}get currentNode(){return this.navigationViewModel?.currentNode}get fov(){return this.camera.fov}set fov(e){this.viewModel.fov=e}get hfov(){return this.viewModel.hfov}get icon(){return"i360-view"}set icon(e){this._overrideIfSome("icon",e)}get imageRenderer(){return this.viewModel.imageRenderer}get imageSize(){return this.viewModel.imageSize}get imageSource(){return this.viewModel.imageSource}set imageSource(e){this.viewModel.imageSource=e}get navigationMode(){return this.navigationViewModel?.navigationMode}get navigationNodes(){return this.navigationViewModel?.navigationNodes}get navigationViewModel(){return this.viewModel.navigationViewModel}set navigationViewModel(e){this.viewModel.navigationViewModel=e}get pitch(){return this.viewModel.pitch}set pitch(e){this.viewModel.pitch=e}get state(){return this.viewModel.state}get ui(){return this.imageRenderer.ui}get vfov(){return this.viewModel.vfov}get yaw(){return this.viewModel.yaw}set yaw(e){this.viewModel.yaw=e}get _navigationUI(){return u(a,{currentNode:this.currentNode,navigate:this.navigate,nodes:this.navigationNodes})}get _sequentialNavigationUI(){return u(s,{layout:"horizontal",uiStrings:this.uiStrings,onAction:e=>{this.navigate(this.currentNode,e)}})}_renderNavigationUI(){switch(this.navigationMode){case"directional":return this._navigationUI;case"sequential":return this._sequentialNavigationUI;default:return null}}render(){return u("calcite-panel",null,u("calcite-panel",{afterCreate:this._afterContainerCreate,bind:this,class:this.classes(c.widget,v)}),this.navigationEnabled?this._renderNavigationUI():null)}static{this.vnodeSelector="calcite-panel"}};e([i({type:Boolean})],h.prototype,"autoLoad",null),e([i({type:t})],h.prototype,"camera",null),e([i()],h.prototype,"clickAction",null),e([i()],h.prototype,"currentNode",null),e([i({type:Number})],h.prototype,"fov",null),e([i({readOnly:!0,type:Number})],h.prototype,"hfov",null),e([i()],h.prototype,"icon",null),e([i({readOnly:!0})],h.prototype,"imageRenderer",null),e([i({readOnly:!0})],h.prototype,"imageSize",null),e([i()],h.prototype,"imageSource",null),e([i({type:Boolean})],h.prototype,"navigationEnabled",void 0),e([i()],h.prototype,"navigationMode",null),e([i()],h.prototype,"navigationNodes",null),e([i()],h.prototype,"navigationViewModel",null),e([i({type:Number})],h.prototype,"pitch",null),e([i({readOnly:!0})],h.prototype,"state",null),e([i()],h.prototype,"ui",null),e([i()],h.prototype,"uiStrings",void 0),e([i({readOnly:!0,type:Number})],h.prototype,"vfov",null),e([d(["click","hittest-response","pixel-location"]),i({type:l})],h.prototype,"viewModel",void 0),e([i({type:Number})],h.prototype,"yaw",null),e([i()],h.prototype,"_navigationUI",null),e([i()],h.prototype,"_sequentialNavigationUI",null),h=e([o("esri.widgets.PanoramicViewer")],h);const g=h;export{g as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../Camera.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import r from"./Widget.js";import a from"./OrientedImageryViewer/components/NavigationUI360.js";import{loadSequentialNavigationUIComponents as n,SequentialNavigationUI as s}from"./OrientedImageryViewer/components/SequentialNavigationUI.js";import l from"./PanoramicViewer/PanoramicViewerViewModel.js";import{loadCalciteComponents as p}from"./support/componentsUtils.js";import{globalCss as c}from"./support/globalCss.js";import"./support/widgetUtils.js";import{vmEvent as d}from"./support/decorators/vmEvent.js";import{tsx as u}from"./support/jsxFactory.js";const v="esri-panoramic-viewer";let h=class extends r{constructor(e){super(e),this.navigationEnabled=!1,this.uiStrings=null,this.viewModel=new l,this._afterContainerCreate=e=>{this.imageRenderer.container=e},this.addGraphic=(e,t)=>{this.viewModel.addGraphic(e,t)},this.addManyGraphics=e=>{this.viewModel.addManyGraphics(e)},this.clearGraphics=()=>{this.viewModel.clearGraphics()},this.clearImage=()=>{this.viewModel.clearImage()},this.loadImage=e=>this.viewModel.loadImage(e),this.navigate=async(e,t)=>await this.viewModel.navigate(e,t),this.removeGraphic=e=>{this.viewModel.removeGraphic(e)},this.removeManyGraphics=e=>{this.viewModel.removeManyGraphics(e)}}loadDependencies(){return Promise.all([p({panel:()=>import("@esri/calcite-components/dist/components/calcite-panel")}),n()])}get autoLoad(){return this.viewModel.autoLoad}set autoLoad(e){this.viewModel.autoLoad=e}get camera(){return this.viewModel.camera}set camera(e){e&&(this.viewModel.camera=e)}get clickAction(){return this.viewModel.clickAction}set clickAction(e){this.viewModel.clickAction=e}get currentNode(){return this.navigationViewModel?.currentNode}get fov(){return this.camera.fov}set fov(e){this.viewModel.fov=e}get hfov(){return this.viewModel.hfov}get icon(){return"i360-view"}set icon(e){this._overrideIfSome("icon",e)}get imageRenderer(){return this.viewModel.imageRenderer}get imageSize(){return this.viewModel.imageSize}get imageSource(){return this.viewModel.imageSource}set imageSource(e){this.viewModel.imageSource=e}get navigationMode(){return this.navigationViewModel?.navigationMode}get navigationNodes(){return this.navigationViewModel?.navigationNodes}get navigationViewModel(){return this.viewModel.navigationViewModel}set navigationViewModel(e){this.viewModel.navigationViewModel=e}get pitch(){return this.viewModel.pitch}set pitch(e){this.viewModel.pitch=e}get state(){return this.viewModel.state}get ui(){return this.imageRenderer.ui}get vfov(){return this.viewModel.vfov}get yaw(){return this.viewModel.yaw}set yaw(e){this.viewModel.yaw=e}get _navigationUI(){return u(a,{currentNode:this.currentNode,navigate:this.navigate,nodes:this.navigationNodes})}get _sequentialNavigationUI(){return u(s,{layout:"horizontal",uiStrings:this.uiStrings,onAction:e=>{this.navigate(this.currentNode,e)}})}_renderNavigationUI(){switch(this.navigationMode){case"directional":return this._navigationUI;case"sequential":return this._sequentialNavigationUI;default:return null}}render(){return u("calcite-panel",null,u("calcite-panel",{afterCreate:this._afterContainerCreate,bind:this,class:this.classes(c.widget,v)}),this.navigationEnabled?this._renderNavigationUI():null)}static{this.vnodeSelector="calcite-panel"}};e([i({type:Boolean})],h.prototype,"autoLoad",null),e([i({type:t})],h.prototype,"camera",null),e([i()],h.prototype,"clickAction",null),e([i()],h.prototype,"currentNode",null),e([i({type:Number})],h.prototype,"fov",null),e([i({readOnly:!0,type:Number})],h.prototype,"hfov",null),e([i()],h.prototype,"icon",null),e([i({readOnly:!0})],h.prototype,"imageRenderer",null),e([i({readOnly:!0})],h.prototype,"imageSize",null),e([i()],h.prototype,"imageSource",null),e([i({type:Boolean})],h.prototype,"navigationEnabled",void 0),e([i()],h.prototype,"navigationMode",null),e([i()],h.prototype,"navigationNodes",null),e([i()],h.prototype,"navigationViewModel",null),e([i({type:Number})],h.prototype,"pitch",null),e([i({readOnly:!0})],h.prototype,"state",null),e([i()],h.prototype,"ui",null),e([i()],h.prototype,"uiStrings",void 0),e([i({readOnly:!0,type:Number})],h.prototype,"vfov",null),e([d(["click","hittest-response","pixel-location"]),i({type:l})],h.prototype,"viewModel",void 0),e([i({type:Number})],h.prototype,"yaw",null),e([i()],h.prototype,"_navigationUI",null),e([i()],h.prototype,"_sequentialNavigationUI",null),h=e([o("esri.widgets.PanoramicViewer")],h);const g=h;export{g as default};