@arcgis/core 4.31.0-next.20240921 → 4.31.0-next.20240923

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.
Files changed (55) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/1810cb638ca1d52de7b2.js +1 -0
  3. package/assets/esri/core/workers/chunks/{69f6f35b04c722aba8cf.js → 238897e72fedd6754af7.js} +1 -1
  4. package/assets/esri/core/workers/chunks/2807eb7bfe4868fe840f.js +1 -0
  5. package/assets/esri/core/workers/chunks/{6c07116c8f7361780803.js → 2b04d2f8466d16a24a80.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{83649583139b818d4dfa.js → 356f6cc122287412b888.js} +1 -1
  7. package/assets/esri/core/workers/chunks/36a1de3752ff13d77b4d.js +1 -0
  8. package/assets/esri/core/workers/chunks/{bf406a46515d5dfebe06.js → 3d207d1c6effda13b448.js} +1 -1
  9. package/assets/esri/core/workers/chunks/460ae228640fd5e545ad.js +1 -0
  10. package/assets/esri/core/workers/chunks/{f14cefc311a21116d21b.js → 4c0d37b799edae391ab2.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{16eda85f728423c4ed02.js → 4ea08495271f6d291b05.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{cf147f34032a8d07f322.js → 53becb5fe10f7f38311f.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{24d45530fe47b3114daf.js → 5652ff08dcc5afd3d739.js} +1 -1
  14. package/assets/esri/core/workers/chunks/5fe1f8881959df0e61ce.js +1 -0
  15. package/assets/esri/core/workers/chunks/62f4eda8a9f4de481dcb.js +1 -0
  16. package/assets/esri/core/workers/chunks/{3fa3e1e6595668ca0e18.js → 686613864dd54d1cae3c.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{5d0d36230a5b8309c9e4.js → 75bf6dff29056a5a1242.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{a7bd5bb21a7f3030ee13.js → 783d66397f16899dd0e9.js} +1 -1
  19. package/assets/esri/core/workers/chunks/7bc57e2a3836ddc8f121.js +1 -0
  20. package/assets/esri/core/workers/chunks/{2658205b1ab2502c0bc7.js → 856c82a20027435fd306.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{99944b05d3142903511c.js → 93fb720bbfb3628f9c71.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{14f77efbfba0ca9efb6c.js → 9dce33a9bcfb852a74d3.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{de7e197223471c7b66a7.js → afb35deb035c9c9225c9.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{5f9beed2a9599b9ce649.js → bc37c0dc14ea54f1b9e8.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{35f92652df2561845d47.js → c9aa8df2f62e6d40b771.js} +1 -1
  26. package/assets/esri/core/workers/chunks/d8435cc010bd2260feec.js +1 -0
  27. package/assets/esri/core/workers/chunks/e5a8ab8d02a616469f1d.js +1 -0
  28. package/assets/esri/core/workers/chunks/f1446e56c35e59b904e1.js +1 -0
  29. package/assets/esri/core/workers/chunks/{6508ff21b0a5725629eb.js → fa3f9691a9bd1bbb25d3.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{008f290833724454160d.js → fab59ee41f96b2378768.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{67ea066a903f5ad31155.js → fe709db8238127f91e59.js} +1 -1
  32. package/layers/FeatureLayer.js +1 -1
  33. package/layers/SubtypeGroupLayer.js +1 -1
  34. package/layers/orientedImagery/core/coverageUtils.js +1 -1
  35. package/layers/orientedImagery/core/utils.js +1 -1
  36. package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
  37. package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
  38. package/layers/orientedImagery/transformations/utils.js +1 -1
  39. package/layers/support/SubtypeSublayer.js +1 -1
  40. package/layers/support/featureLayerUtils.js +1 -1
  41. package/package.json +1 -1
  42. package/support/revision.js +1 -1
  43. package/views/interactive/sketch/constraintUtils.js +1 -1
  44. package/views/interactive/sketch/constraints.js +1 -1
  45. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  46. package/assets/esri/core/workers/chunks/0eb789af3c26fecdf3be.js +0 -1
  47. package/assets/esri/core/workers/chunks/41a3c7d286a050002d20.js +0 -1
  48. package/assets/esri/core/workers/chunks/59e4731d246203e94a96.js +0 -1
  49. package/assets/esri/core/workers/chunks/69c09478c899cd5e5013.js +0 -1
  50. package/assets/esri/core/workers/chunks/7088f771163fda53d196.js +0 -1
  51. package/assets/esri/core/workers/chunks/79ed119c70ce6ea02f71.js +0 -1
  52. package/assets/esri/core/workers/chunks/b5c02dbf540ededb863c.js +0 -1
  53. package/assets/esri/core/workers/chunks/eeacd5fa9fb9b1dee5f7.js +0 -1
  54. package/assets/esri/core/workers/chunks/f7c96d34c70ed36da7c2.js +0 -1
  55. package/assets/esri/core/workers/chunks/f9e90a2fda559ca68848.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import"../../geometry.js";import t from"../../Graphic.js";import"../../symbols.js";import{isSome as r,equals as i}from"../../core/arrayUtils.js";import{createTask as a}from"../../core/asyncUtils.js";import o from"../../core/Collection.js";import{deprecatedProperty as s}from"../../core/deprecate.js";import n from"../../core/Error.js";import l from"../../core/Evented.js";import{isSerializable as c}from"../../core/JSONSupport.js";import{equalsShallow as u}from"../../core/lang.js";import h from"../../core/Logger.js";import{clamp as p}from"../../core/mathUtils.js";import{abortMaybe as m,destroyMaybe as d}from"../../core/maybe.js";import{EsriPromise as g}from"../../core/Promise.js";import{throwIfAborted as y,isAbortError as f,waitTick as v}from"../../core/promiseUtils.js";import w from"../../core/ReactiveMap.js";import{on as F,watch as b,syncAndInitial as _,initial as I}from"../../core/reactiveUtils.js";import{sqlAnd as P}from"../../core/sql.js";import{property as C}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as S}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as V}from"../../core/support/UpdatingHandles.js";import{projectWithZConversion as A}from"../../geometry/projection.js";import{isPolygon as j}from"../../geometry/support/jsonUtils.js";import{geographicToWebMercator as M}from"../../geometry/support/webMercatorUtils.js";import O from"../../layers/GraphicsLayer.js";import{searchImages as k}from"../../layers/orientedImagery/queries.js";import{calculateSuitabilities as B}from"../../layers/orientedImagery/core/bestImageUtils.js";import{createCoveragePolygon as R,computePolygonForInspection as G,resizePolygon as L,checkIfPolygonContainsSelectedPoint as x}from"../../layers/orientedImagery/core/coverageUtils.js";import{isElevationSource as E}from"../../layers/orientedImagery/core/ElevationSourceDefinitions.js";import{imageToWorld as H,imageToWorldPanoramic as T}from"../../layers/orientedImagery/transformations/imageToWorld.js";import D from"../../layers/orientedImagery/transformations/updateElevation.js";import{getElevationSampler as U}from"../../layers/orientedImagery/transformations/updateElevationUtils.js";import{getInitialAngle as z,convertPixelToHeadingPitch as W,getUpdateElevationProps as N,isElevationSampler as q,getImageToWorldProperties as $,getImageToWorldPanoramicProperties as J,geographicToLTP as K,getWorldToImageProperties as Q,convertHeadingPitchToSphereVertex as X}from"../../layers/orientedImagery/transformations/utils.js";import{worldToImagePanoramic as Y,worldToImage as Z}from"../../layers/orientedImagery/transformations/worldToImage.js";import{getFloorFilterClause as ee}from"../../layers/support/floorFilterUtils.js";import te from"../../rest/support/AttachmentQuery.js";import{scale as re}from"../../views/draw/support/drawUtils.js";import{ViewEventPriorities as ie}from"../../views/input/InputManager.js";import ae from"../PanoramicViewer.js";import{invalidCameraHeading as oe,sectorsInOrder as se,sectorsRadii as ne}from"./constants.js";import{crossSymbol as le,crossSymbol3D as ce,sourcePointSymbol as ue,diamondSymbol as he,diamondSymbol3D as pe,activeSourcePointSymbol as me}from"./symbols.js";import{isNoAttachmentError as de,getContentType as ge,isTifOrMrf as ye,filterOILLayerView as fe,isSceneView as ve,isGraphic as we,calculateSegment as Fe,calculateDirection as be}from"./utils.js";import _e from"./components/ImageViewer.js";import Ie from"../../geometry/Point.js";import Pe from"../../geometry/SpatialReference.js";import Ce from"../../symbols/SimpleLineSymbol.js";import Se from"../../geometry/Multipoint.js";import Ve from"../../geometry/Polyline.js";import Ae from"../../geometry/Polygon.js";const je={click:"view-click",imageClick:"image-click",interactionHandles:"interaction-handles",footprintHandles:"footprint-handles"},Me=new Set(["JPG","JPEG"]),Oe=/\.(\w+)$/,ke=e=>"FA"===e;let Be=class extends(l.EventedMixin(g)){constructor(e){super(e),this.additionalFeatures=new o,this.additionalCameraLocations=new o,this.additionalFootprints=new o,this.bestFeatureAngle=0,this.bestFeatureCurrentFootprint=null,this.bestFeatureFootprint=null,this.coverageFrustums=new o,this.coveragePolygons=new o,this.currentBestFeature=null,this.currentBestFeatureLocation=null,this.currentCoverageVisible=!0,this.determineWorkflowForFeature=()=>{m(this._featureChangedTask),this._featureChangedTask=a((async e=>{const{currentBestFeature:t,selectedPoint:r,view:i}=this;if(i?.closePopup(),t&&r){this._initialCurrentCoverageUpdate=!0;try{await this._updatePointsAndPolygons({signal:e}),await this._loadImage({signal:e})}catch(a){f(a)||(this.loadImageError(a),h.getLogger(this).error("#loadIImage()","error occured while loading image",a))}}}))},this.disabled=!1,this.displayMessage={key:"onLoadMessage",type:"info"},this.drawFootprint=()=>{this.bestFeatureFootprint&&this.updateCurrentCoveragePolygon(this.bestFeatureFootprint)},this.features=new o,this.isAdditionalCoverageVisible=!1,this.isAdditionalPointSourcesVisible=!1,this.layer=null,this.localPort=null,this.mapImageConversionToolState=!1,this.navigatorCurrentBestFeature=null,this.overlayedCameraLocations=new o,this.overlayedMapFeatures=new w,this.pointSources=new o,this.previousFeatureAngle=0,this.selectedPoint=null,this.shouldShowSelectedImage=!1,this.updateFootprint=async(e,t)=>{"image-loaded"===this.state&&await(this._adapter?.updateFootprint(e,t))},this.updateFootprintPanorama=async(e,t)=>{await(this._adapter?.updateFootprintPanorama(e,t))},this._adapter=null,this._highlightedFeatureHandle=null,this._imageViewer=new _e,this._initialCurrentCoverageUpdate=!0,this._overlays=new O({listMode:"hide",internal:!0,elevationInfo:{mode:"absolute-height"}}),this._panoramicViewer=new ae,this._referencePointOnGround=null,this._referencePointOnImage=null,this._sectorData=null,this._updatingHandles=new V,this._clickTask=null,this._crossSymbol=null,this.footprintExtent=null,this._featureChangedTask=null,this._openPopupTask=null,this._suitabilities=null,this._transformController=new AbortController,this._updateFootprintTask=null,this.highlight=e=>{if(!this._overlaysView)return;this.removeHighlight();const t=this.additionalFootprints.find((({attributes:{imageID:t}})=>t===Number(e)));this._highlightedFeatureHandle=t?this._overlaysView?.highlight(t):null},this.loadImageFromSource=async(e,t)=>this._updatingHandles.addPromise(this._loadImageFromSourceInternal(e,t)),this.loadImageViewer=e=>{this._imageViewer.container=e},this.loadPanoramicViewer=e=>{this._panoramicViewer.container=e},this.removeHighlight=()=>this._highlightedFeatureHandle?.remove(),this.toggleImageAttributes=()=>{m(this._openPopupTask),this._openPopupTask=a((async e=>{const{currentBestFeature:r,popupEnabled:i,layer:a,view:o}=this;if(o?.closePopup(),!(o&&r&&i&&a))return;const{attributes:s,geometry:n}=r,l=new t({geometry:n,attributes:s.toJSON(),layer:a});y(e),await o.openPopup({features:[l],location:s.location.clone()})}))},this._createViewClickHandle=()=>{if(this.removeHandles(je.click),"disabled"===this.state||null==this.view)return;const e=this.mapImageConversionToolState&&"image-loaded"===this.state?this._mapImageConversionToolViewClickHandler:this._viewClickHandler;this.addHandles(this.view.on("click",e,ie.WIDGET),je.click)},this._createImageClickHandle=()=>{this.removeHandles(je.imageClick);const{mapImageConversionToolState:e,mode:t,activeViewer:r,currentBestFeature:i,footprintExtent:o}=this,s=r?.imageSize;if(!(e&&"none"!==t&&s&&o&&i))return;r.clickAction="pixel-location";let n=null;const l=F((()=>r),"pixel-location",(e=>{this.plotReferencePointOnImage(e),n?.abort(),n=a((async r=>{if(!e)return;const a=await this.getMapPoint(e,{feature:i,imageSize:s,mode:t});y(r),this.plotReferencePointOnGround(a)}))}));this.addHandles(l,je.imageClick)},this._getImageSourceFromAttachment=async(e,t,r)=>{const i=new te({objectIds:[t]}),a=await e.queryAttachments(i,r),o=a[`${t}`]?.[0],s=o?.url;if(!s)throw new n("NoAttachmentError","no attachments found",{[e.objectIdField]:t,layer:e});return{datasetFormat:o.contentType.split("/")[1].toUpperCase(),url:s}},this._loadAdapter=async e=>{const{view:t}=this;if(t)switch(t.type){case"2d":{const{default:t}=await import("./adapters/OrientedImageryViewerViewModelAdapter2D.js");y(e),this._adapter=new t(this);break}case"3d":{const{default:t}=await import("./adapters/OrientedImageryViewerViewModelAdapter3D.js");y(e),this._adapter=new t(this);break}}else this._adapter=null},this._loadImage=async e=>{const{currentBestFeature:t,layer:r,mode:i}=this;if(this.clearGraphics(),!r||!t||"none"===i)return;const{attributes:a}=t,{imagePath:o,imageRotation:s,cameraHeading:n,cameraRoll:l,cameraPitch:c,objectId:u,cameraOrientation:p,location:m}=a,d=(l??0)+(s??0),g=m.spatialReference.isWGS84&&4!==p?.type?M(m):new Ie(m);let v=o;if(ke(o))try{v=await this._getImageSourceFromAttachment(r,u,e)}catch(w){if(f(w))return;return de(w)?(h.getLogger(this).error(w),void this.setMessage("noAttachment","error",`${r.objectIdField}: ${u}`)):(h.getLogger(this).error(w,{[r.objectIdField]:u,layer:r}),void this.setMessage("imageLoadError","error",`query-attachments-failed:${r.objectIdField} ${u}`))}try{await this.loadImageFromSource(v,{imageRotation:d,options:e,pitch:c,yaw:n,mode:i,cameraLocation:g}),y(e),await this.transformAndPlotSelectedLocation(e)}catch(w){f(w)||this.loadImageError(w)}},this._loadImageFromSourceInternal=async(e,t)=>{const{mode:r,imageRotation:i,options:a}=t,o="string"==typeof e,s=o?e:e.url,{origin:n,pathname:l,searchParams:c}=new URL(s);let u=o?l.match(Oe)?.[1]??"":e.datasetFormat;if(!u){const e=await ge(s,{...t.options});e&&(u=e.split("/")[1]),u??="UNKNOWN FORMAT"}switch(r){case"default":this._imageViewer.imageSource={datasetFormat:u.toUpperCase(),url:`${n}${l}`},this._imageViewer.customParameters=Object.fromEntries(c),this._imageViewer.imageRotation=i??0,await this._imageViewer.loadImage(a);break;case"panoramic":if(Me.has(u.toUpperCase())){const{selectedPoint:e}=this,{pitch:r,yaw:i,cameraLocation:o,viewAngle:n}=t;this._panoramicViewer.imageSource=s;let l=i??0;"number"==typeof n?l=n-l:o&&e&&(l=await z(o,e)-l),this._panoramicViewer.pitch=r??0,this._panoramicViewer.yaw=l,await this._panoramicViewer.loadImage(a)}else this.setMessage("unsupportedPanoramicImageryError","error",void 0,{datasetFormat:u});break}},this._mapImageConversionToolViewClickHandler=e=>{e.stopPropagation(),e.preventDefault(),e.mapPoint&&this.plotMapPoint(e.mapPoint)},this._viewClickHandler=e=>{this._clickTask?.abort(),this._clickTask=a((async t=>{const{pointerType:r,button:i,mapPoint:a}=e;if(("mouse"!==r||0===i)&&a)return e.stopPropagation(),e.preventDefault(),this._updatingHandles.addPromise(this.loadBestImage(a,{signal:t}))}))},this.plotSelectedPointOnImage=async(e,r)=>{if(await v(r),!e)return;const i=new Ie({...c(e)?e.toJSON():e});if("default"===this.mode)i.x-=.5,i.y=.5-i.y,i.spatialReference=this._imageViewer.imageRenderer.spatialReference.clone(),this._crossSymbol=new t({geometry:i,symbol:le}),this._imageViewer.addGraphic(this._crossSymbol,0);else if("panoramic"===this.mode){const{imageSize:r}=this._panoramicViewer;if(!r)return;const[i,a]=r,{heading:o,pitch:s}=W(e,i,a),n=X(o,s);this._crossSymbol=new t({geometry:new Ie(n,Pe.WebMercator),symbol:ce}),this._panoramicViewer.addGraphic(this._crossSymbol,0)}},this.handleSectorClick=this.handleSectorClick.bind(this),this.searchBestImage=this.searchBestImage.bind(this),this.transformAndPlotReferencePointOnImage=this.transformAndPlotReferencePointOnImage.bind(this),this.updateSuitabilities=this.updateSuitabilities.bind(this),this.determineWorkflowForFeature=this.determineWorkflowForFeature.bind(this),this.selectBestFeature=this.selectBestFeature.bind(this),this.drawFootprint=this.drawFootprint.bind(this)}initialize(){this.addHandles([b((()=>this.view),(()=>{this.load()}),_),b((()=>this.view?.map),((e,t)=>{t?.layers.remove(this._overlays),e?.layers.add(this._overlays)}),I),b((()=>this.view?.map?.allLayers?.length),(e=>{e&&this.view?.map?.layers.reorder(this._overlays,e-1)}),I),b((()=>[this.state,this.mapImageConversionToolState,this.view]),(()=>{this._createViewClickHandle(),this._createImageClickHandle()}),_),b((()=>this.bestFeatureAngle),((e,t)=>{this.previousFeatureAngle=t??0}),_),b((()=>this.currentBestFeature),((e,t)=>{this.determineWorkflowForFeature(e,t)}),{sync:!0}),b((()=>this.mode),(e=>{switch(this.removeHandles(je.interactionHandles),e){case"default":this.addHandles(b((()=>this._imageViewer.imagePointsInView),(e=>{e&&(m(this._updateFootprintTask),this._updateFootprintTask=a((async t=>{await this.updateFootprint(e,{signal:t})})))}),{..._,equals:(e,t)=>i(e,t,u)}),je.interactionHandles);break;case"panoramic":this.addHandles(b((()=>{const{currentBestFeature:e,state:t}=this,{imageSize:r,vfov:i,hfov:a,pitch:o,yaw:s}=this._panoramicViewer;return e&&r&&"image-loading"!==t?[i,a,s,o]:null}),(e=>{if(!e||"image-loading"===this.state)return;const[t,r,i,o]=e;m(this._updateFootprintTask),this._updateFootprintTask=a((async e=>{await this.updateFootprintPanorama({verticalFieldOfView:t,horizontalFieldOfView:r,yaw:i,pitch:o},{signal:e})}))}),{..._,equals:(e,t)=>i(e,t,u)}),je.interactionHandles)}}),_),b((()=>[this.brightness,this.contrast,this.sharpness]),(()=>{const{_imageViewer:e,brightness:t,contrast:r,mode:i,sharpness:a}=this;"default"===i&&(e.brightness=t,e.contrast=r,e.sharpness=a)}),_)])}destroy(){this._updateFootprintTask=m(this._updateFootprintTask),this._clickTask=m(this._clickTask),this.coverageFrustums.destroy(),this.coveragePolygons.destroy(),this.pointSources.destroy(),this.additionalFootprints.destroy(),this.additionalCameraLocations.destroy(),this.bestFeatureFootprint=d(this.bestFeatureFootprint),this.bestFeatureCurrentFootprint=d(this.bestFeatureCurrentFootprint),this._crossSymbol=d(this._crossSymbol),this._referencePointOnGround=d(this._referencePointOnGround),this._referencePointOnImage=d(this._referencePointOnImage),this._overlays&&this.view?.map?.remove(this._overlays),this._overlays.destroy()}get activeLayer(){return s(h.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer}set activeLayer(e){s(h.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer=e}get activeViewer(){const{_imageViewer:e,_panoramicViewer:t,mode:r}=this;switch(r){case"default":return e;case"panoramic":return t;default:return null}}get brightness(){return this._get("brightness")??0}set brightness(e){this._set("brightness",p(e,-10,10))}get contrast(){return this._get("contrast")??0}set contrast(e){this._set("contrast",p(e,-10,10))}get featureCount(){return this.features?.length??0}get imageGalleryEnabled(){return ye(this.currentBestFeature?.attributes.imagePath.trim())}get imageLoaded(){return s(h.getLogger(this),"imageLoaded",{replacement:'Use OrientedImageryViewer.state === "image-loaded"',version:"4.29",warnOnce:!0}),"image-loaded"===this.state}get invalidCameraHeading(){return this.currentBestFeature?.attributes?.cameraHeading===oe}get imagePointsInView(){const{mode:e,_imageViewer:t}=this;return"default"===e?t.imagePointsInView:null}get layerView(){const{layer:e,view:t}=this;if(e&&t)return t.allLayerViews.find(fe(e))}get layerFloorFilterClause(){const{layerView:e}=this;return e?ee(e):null}get mode(){const e=this.currentBestFeature?.attributes;if(!e)return"none";const{horizontalFieldOfView:t,isSpherical:r}=e;return 360===t||r?"panoramic":"default"}get popupEnabled(){return!0===this.layer?.popupEnabled}get referencePoint(){return this._referencePointOnGround?.geometry}get sectorData(){const{_sectorData:e}=this;return e?se.map((t=>e[t])):null}get sharpness(){return this._get("sharpness")??0}set sharpness(e){this._set("sharpness",p(e,0,1))}get state(){const{mode:e,disabled:t}=this;if(t)return"disabled";if(!this.isFulfilled())return"loading";if(this.isRejected())return"error";if(this._updatingHandles.updating)return"image-loading";if("error"===this.displayMessage?.type)return"image-load-error";switch(e){case"default":return this._imageViewer.state;case"panoramic":return this._panoramicViewer.state}return"ready"}get thumbnails(){const{features:e}=this;return e?new o(e.map((({attributes:{imagePath:e,objectId:t,cameraRoll:r,imageRotation:i}})=>{const a=e.trim();return ye(a)?{url:a,objectId:t,rotation:(r??0)+(i??0)}:null})).filter(r)):null}set view(e){this._set("view",e)}get _overlaysView(){return this.view?.layerViews.find((({layer:e})=>e===this._overlays))}filterByFootprints(e,t){const r=[],i=[],a=[];return e.forEach((e=>{const{layer:{coveragePercent:o},attributes:s}=e;let n;const{polygon:l,frustum:c}=R(s);if(n=l.clone(),s.isInspection&&(n=G(s)),o&&(n=L(n,o)),x(n,t)){a.push(e);const{geometry:t,objectId:o,cameraHeight:n,cameraHeading:u}=s,h=t.clone();h.z=n,h.imageID=o,this.pointSources.push(h),u!==oe&&(r.push(l),c&&i.push(c))}})),{features:a,polygons:r,frustums:i}}getCurrentCoveragePolygon(){return this.bestFeatureCurrentFootprint}getCurrentBestFeaturePolygon(){return this.bestFeatureFootprint}handleSectorClick(e){if(isNaN(e))return;const t=this._sectorData?.[se[e]];t?.length&&this._updateCurrentBestFeature(t.at(0))}handleFeatureClick(e){const{sector:t,featureIndexInSector:r}=e;if(isNaN(r))return;const i=this._sectorData?.[t];i?.length&&this._updateCurrentBestFeature(i.at(r))}async load(e){return this.addResolvingPromise(this._loadAdapter(e).catch((e=>{if(!f(e))throw e}))),this}async loadBestImage(e,t){return this.view?.closePopup(),this.displayMessage=null,this.selectedPoint=e.spatialReference.isGeographic?M(e):e.clone(),this.features.removeAll(),this.currentBestFeature=null,this.additionalFeatures.removeAll(),this.additionalFootprints.removeAll(),this.additionalCameraLocations.removeAll(),this.bestFeatureCurrentFootprint=d(this.bestFeatureCurrentFootprint),this._overlays?.removeAll(),this._fetchFeaturesWithController(e,t)}loadImageError(e){h.getLogger(this).error("oriented-imagery-viewer:load-image",e),this.setMessage("imageLoadError","error",e.message)}async overlayCameraLocations(e){const{activeViewer:r,currentBestFeature:i,overlayedCameraLocations:a,layer:o,mode:s}=this,n=r?.imageSize;if(!n||!i||!o||"none"===s)return;const{polygon:l}=R(i.attributes);if(r.removeManyGraphics(a.toArray()),a.removeAll(),e){const{features:e}=await o.queryFeatures({where:`${o.objectIdField} <> ${i.attributes.objectId}`,geometry:l,returnGeometry:!0,outFields:[o.objectIdField]}),c=await Promise.all(e.map((async e=>{const{attributes:r,geometry:a}=e,o=await this.getPixels(a,{feature:i,imageSize:n,mode:s}),l=ue.clone();return l.outline=new Ce({color:[0,0,0],width:1}),new t({attributes:r,symbol:l,geometry:o})})));a.addMany(c),r.addManyGraphics(a.toArray())}}overlayGraphicsOnImage(e,t){this.overlayedMapFeatures.set(e,t),this.activeViewer?.addManyGraphics(t.toArray())}async overlayMapFeatures(e){const{activeViewer:i,currentBestFeature:a,mode:s}=this,n=i?.imageSize;if(!n||!a||"none"===s)return;const{polygon:l}=R(a.attributes),{features:c}=await e.queryFeatures({geometry:l,returnGeometry:!0,outFields:[e.objectIdField]}),u=new o((await Promise.all(c.map((async r=>{const{attributes:i,geometry:o}=r,l=r.symbol?.clone()??e.renderer?.getSymbol(r).clone();switch(o?.type){case"point":{const r=await this.getPixels(o,{feature:a,imageSize:n,mode:s});return new t({attributes:i,layer:e,symbol:l,geometry:r,visible:e.visible})}case"polygon":{const{rings:r,spatialReference:c}=o,u=r.flatMap((e=>e.map((([e,t,r])=>new Ie({x:e,y:t,z:r,spatialReference:c}))))),h=await this.getPixels(u,{feature:a,imageSize:n,mode:s});return new t({attributes:i,layer:e,symbol:l,geometry:new Ae({rings:[h.map((e=>e.toArray()))],spatialReference:Pe.WebMercator}),visible:e.visible})}case"polyline":{const{paths:r,spatialReference:c}=o,u=r.flatMap((e=>e.map((([e,t,r])=>new Ie({x:e,y:t,z:r,spatialReference:c}))))),h=await this.getPixels(u,{feature:a,imageSize:n,mode:s});return new t({attributes:i,layer:e,symbol:l,geometry:new Ve({paths:[h.map((e=>e.toArray()))],spatialReference:Pe.WebMercator}),visible:e.visible})}case"multipoint":{const{points:r,spatialReference:c}=o,u=r.map((([e,t,r])=>new Ie({x:e,y:t,z:r,spatialReference:c}))),h=await this.getPixels(u,{feature:a,imageSize:n,mode:s});return new t({attributes:i,layer:e,symbol:l,geometry:new Se({points:h.map((e=>e.toArray())),spatialReference:Pe.WebMercator}),visible:e.visible})}}return null})))).filter(r));this.overlayGraphicsOnImage(`${e.id}`,u)}async getPixels(e,t){const{imageSize:r,mode:i}=t,a=(await this.worldToImage(Array.isArray(e)?e:[e])).map((e=>{if("default"===i)return new Ie({x:e.x-.5,y:.5-e.y,spatialReference:Pe.WebMercator});const[t,a]=r,{heading:o,pitch:s}=W(e,t,a),n=X(o,s);return new Ie(n,Pe.WebMercator)}));return Array.isArray(e)?a:a[0]}async getMapPoint(e,t){const{feature:r,mode:i,imageSize:a}=t,o=await N(r.attributes.cameraHeight,{elevationSample:r.elevationSample,elevationSource:r.attributes.elevationSource,extent:this.footprintExtent});let s;if("elevationSample"in o&&q(o.elevationSample)&&(r.elevationSample=o.elevationSample),"default"===i){const t=$(r.attributes,a);s=await H(Array.isArray(e)?e:[e],t,o)}else{const t=J(r.attributes,a[0],a[1]);s=await T(Array.isArray(e)?e:[e],t,o)}return Array.isArray(e)?s:s[0]}async plotMapPoint(e){return this.plotReferencePoint(e),this.transformAndPlotReferencePointOnImage({feature:this.currentBestFeature,selectedLocation:e,options:{signal:this._transformController?.signal}})}plotReferencePointOnGround(e){this._referencePointOnGround&&(this._overlays?.remove(this._referencePointOnGround),this._referencePointOnGround.destroy()),null!=e&&(this._referencePointOnGround=new t({geometry:new Ie({...e.toJSON()}),symbol:he}),this.view?this._overlays?.add(this._referencePointOnGround):this.emit("plot-ground-point",{data:{point:this._referencePointOnGround?.geometry}}))}plotReferencePointOnImage(e){if("image-loaded"===this.state)switch(this._referencePointOnImage&&(this._imageViewer.removeGraphic(this._referencePointOnImage),this._panoramicViewer.removeGraphic(this._referencePointOnImage),this._referencePointOnImage.destroy()),this.mode){case"default":{const r=c(e)?e.toJSON():e;r.x-=.5,r.y=.5-r.y,this._referencePointOnImage=new t({geometry:new Ie({spatialReference:this._imageViewer.imageRenderer.spatialReference.clone(),...r}),symbol:he}),this._imageViewer.addGraphic(this._referencePointOnImage,0);break}case"panoramic":{const{imageSize:r}=this._panoramicViewer;if(!r)return;const[i,a]=r,{heading:o,pitch:s}=W(e,i,a),n=X(o,s);this._referencePointOnImage=new t({geometry:new Ie(n,Pe.WebMercator),symbol:pe}),this._panoramicViewer.addGraphic(this._referencePointOnImage,0);break}}}removeAllOverlayMapFeatures(){this.overlayedMapFeatures.forEach((e=>{this._imageViewer.removeManyGraphics(e.toArray())})),this.overlayedMapFeatures.clear()}removeOverlayedGraphicsOnImage(e){const t=this.overlayedMapFeatures.get(e);t?.length&&(this._imageViewer.removeManyGraphics(t.toArray()),this.overlayedMapFeatures.delete(e))}resetImage(){switch(this.setMessage("onLoadMessage","info"),this.mode){case"default":this._imageViewer.clearImage(),this._imageViewer.clearGraphics();break;case"panoramic":this._panoramicViewer.clearGraphics()}this._clickTask=m(this._clickTask)}async searchBestImage(e,t){try{const r=await k(e,t);r&&await this._processFeatureResponse(r,e.point,{signal:t?.signal})}catch(r){f(r)||(this.setMessage("imageLoadError","error",r.message),h.getLogger(this).error("error occurred while finding best image",r))}}selectBestFeature(e){this.currentBestFeature=this.features?.find((({attributes:t})=>t.objectId===Number(e)))}setAdditionalCameraLocationsVisibility(e){this.additionalCameraLocations.forEach((t=>{t.visible=e}))}setAdditionalCoverageVisibility(e){this.additionalFootprints.forEach((t=>{t.visible=e}))}setCurrentCoverageVisibility(e){this.bestFeatureCurrentFootprint&&(this.bestFeatureCurrentFootprint.visible=e),this.currentBestFeatureLocation&&(this.currentBestFeatureLocation.visible=e)}setMapImageConversionToolState(e){this.mapImageConversionToolState=e}toggleAllOverlayMapFeatures(e){this.overlayedMapFeatures.forEach((t=>{this._toggleVisiblity(t,e)}))}toggleOverlayMapFeatures(e,t){const r=this.overlayedMapFeatures.get(e);r&&this._toggleVisiblity(r,t)}async transformAndPlotReferencePointOnImage(e){const{selectedLocation:t,options:r}=e,i=this.bestFeatureFootprint?.geometry,a=j(i)&&i.contains(t),o="mesh"===i?.type&&i?.extent.contains(t);if(!a&&!o)return;const s=await this.worldToImage(t,r);return s?(y(r),this.plotReferencePointOnImage(s),{x:s.x,y:s.y}):void 0}updateSuitabilities(e){e.sort(((e,t)=>e.suitability-t.suitability)),this._suitabilities=e;const t=this._suitabilities.map((({feature:e})=>e));this._initialCurrentCoverageUpdate=!0,this._updateFeatures(t),this._groupFeaturesBySectors()}async _fetchFeatures(e,t){if(!this.view)return;const r=this.layer;if(r){const i={include:r},a=this.view.toScreen(e);if(!a)return;const o=await this.view.hitTest(a,i);return this._processHitTestResults(r,o,t)}}async _fetchFeaturesWithController(e,t){try{await this._fetchFeatures(e,t)}catch(r){if(f(r))return;this.setMessage("imageLoadError","error"),h.getLogger(this).error("error occurred while fetching features",r)}}_groupFeaturesBySectors(){const{_suitabilities:e,additionalFeatures:t,currentBestFeature:r,features:i,invalidCameraHeading:a}=this;if(!e||!t||!r||!i||a)return void(this._sectorData=null);this._sectorData={};for(const c of se)this._sectorData[c]=new o;const s=e.map(((e,t)=>({...e,featureIndex:t})));s.sort(((e,t)=>e.trueSuitability-t.trueSuitability));const n=s.map((({distance:e})=>e)),l=Math.max(...n);s.forEach((e=>{const{distance:t,angle:r,featureIndex:a}=e,o=t/l*ne[2],s=Fe(t,l),n=be(r);if(!this._sectorData)return;const c=ne[3]+o*Math.sin(r*Math.PI/180),u=ne[3]+o*Math.cos(r*Math.PI/180);let h;const p=i.at(a),m=p===this.currentBestFeature,d=this.currentBestFeature?.attributes.cameraPitch&&this.currentBestFeature?.attributes.cameraPitch<5;if(m&&d)h=-90;else{const e=c-ne[3],t=u-ne[3],r=t/Math.sqrt(e**2+t**2);let i=180*Math.acos(r)/Math.PI;(e<0&&t<0||e<0&&t>0)&&(i*=-1),h=i}const g=""===s?n:`${s}_${n}`;m&&(h===this.bestFeatureAngle?this.previousFeatureAngle=h:this.bestFeatureAngle=h,this.navigatorCurrentBestFeature=d?null:{x:c,y:u,direction:n});const y=this._sectorData[g];y.add({angle:r,featureIndex:a,x:c,y:u,objectID:p.attributes.objectId,sector:g,featureIndexInSector:y.length})}))}async _processFeatureResponse(e,t,r){const{features:i}=e;if(!i?.length)return this.setMessage("noImageError","error"),void(this.currentBestFeature=null);this.coveragePolygons.removeAll(),this.coverageFrustums.removeAll(),this.pointSources.removeAll();const{features:a,polygons:o,frustums:s}=this.filterByFootprints(i,t);if(!a.length)return this.setMessage("noImageError","error"),void(this.currentBestFeature=null);let n;if(this.coveragePolygons.addMany(o),this.coverageFrustums.addMany(s),o[0]){const e=new Ae({spatialReference:o[0].spatialReference});for(const{rings:r}of o)e.addRing(r[0]);const t=[];for(const{geometry:r}of a)e.contains(r)||t.push(r);if(e.addRing(t),this.footprintExtent=re(e.extent,2,2),this.view?.supportsGround)try{n=await this.view.map.ground.createElevationSampler(this.footprintExtent,r)}catch(l){f(l)||h.getLogger(this).error(l)}}if((n||a[0].attributes.elevationSource)&&this.footprintExtent){const e=a[0].attributes.elevationSource;E(e)&&!n&&(n=await U({extent:this.footprintExtent,lod:e.lod,url:e.url,rasterFunction:e.rasterFunction}));const r=await N(a[0].attributes.cameraHeight,{elevationSample:n,elevationSource:e,extent:this.footprintExtent}),[i,...o]=await D([t,...a.map((e=>e.attributes.geometry.clone()))],r);a[0].elevationSample=n??r.elevationSample,t.elevation=i.z,a.forEach(((e,t)=>{e.attributes.elevation=o[t].z}))}a[0].elevationSample&&a.forEach((e=>{e.elevationSample=a[0].elevationSample})),this._suitabilities=B({features:a,selectedPoint:t,camera:ve(this.view)?this.view.camera:null,currentImage:this.currentBestFeature}),this.updateSuitabilities(this._suitabilities)}async _processHitTestResults(e,t,r){const{screenPoint:i,results:[a]}=t,o="graphic"===a?.type&&this.shouldShowSelectedImage,s=a?.mapPoint??this.view?.toMap(i);if(!s)return;const{layerFloorFilterClause:n}=this,l={layerInstanceOrURL:e,point:s,queryParams:{where:P("1=1",P(e.definitionExpression,n)),maximumDistance:e.maximumDistance,objectIds:o?[a.graphic.getAttribute(e.objectIdField)]:void 0}};await this.searchBestImage(l,r)}_toggleVisiblity(e,t){e.forEach((e=>{e.visible=t}))}_updateFeatures(e){if(!e.length)return this.currentBestFeature=null,void this.additionalFeatures.removeAll();this.features.removeAll(),this.features.addMany(e),e.length>1?this.additionalFeatures.addMany(e.slice(1)):this.additionalFeatures.removeAll(),this.currentBestFeature=e[0]}async _updatePointsAndPolygons(e){const{pointSources:r,currentBestFeature:i,currentCoverageVisible:a,isAdditionalPointSourcesVisible:o}=this;if(i&&(this.additionalFootprints.removeAll(),this.additionalCameraLocations.removeAll(),this.bestFeatureCurrentFootprint&&(this.bestFeatureCurrentFootprint.destroy(),this.bestFeatureCurrentFootprint=null,this.bestFeatureFootprint=null),!this.invalidCameraHeading)){await(this._adapter?.createFootprints(e)),y(e);for(const e of r)e.imageID===i.attributes.objectId?this.currentBestFeatureLocation=new t({attributes:{imageID:e.imageID},geometry:e,symbol:me,visible:a}):this.additionalCameraLocations.push(new t({attributes:{imageID:e.imageID},geometry:e,symbol:ue,visible:o}))}}_updateCurrentBestFeature(e){if(!e)return;this.currentBestFeature=this.features?.at(e.featureIndex);const t=this.currentBestFeature?.attributes.cameraPitch&&this.currentBestFeature?.attributes.cameraPitch<5;let r;if(t)r=-90;else{const t=e.x-ne[3],i=e.y-ne[3],a=i/Math.sqrt(t**2+i**2);let o=180*Math.acos(a)/Math.PI;(t<0&&i<0||t<0&&i>0)&&(o*=-1),r=o}r===this.bestFeatureAngle?this.previousFeatureAngle=r:this.bestFeatureAngle=r,this.navigatorCurrentBestFeature=t?null:{x:e.x,y:e.y,direction:e.sector.includes("_")?e.sector.split("_")[1]:e.sector}}clearGraphics(){this._imageViewer.clearGraphics(),this._panoramicViewer.clearGraphics()}plotReferencePoint(e){"mapPoint"in e?this.plotReferencePointOnGround(e.mapPoint):this.plotReferencePointOnGround(e)}setMessage(e,t,r,i){this.displayMessage={key:e,type:t,data:r,map:i}}async transformAndPlotSelectedLocation(e){const{currentBestFeature:t,invalidCameraHeading:r,selectedPoint:i,state:a}=this;if(this._crossSymbol&&(this._panoramicViewer.removeGraphic(this._crossSymbol),this._imageViewer.removeGraphic(this._crossSymbol),this._crossSymbol=d(this._crossSymbol)),!i||!t||"image-loaded"!==a||r)return;let o;try{o=await this.worldToImage(i,e),y(e),await this.plotSelectedPointOnImage(o,e)}catch(s){f(s)||h.getLogger(this).error("failed to transform map point to pixel, cross symbol will not be plotted on image",{error:s,selectedPoint:i,feature:t})}}async worldToImage(e,t){const{footprintExtent:r}=this,{imageSize:i}=this.activeViewer;if("none"===this.mode||!this.currentBestFeature||!i||!r)return;const{attributes:{location:a,cameraOrientation:o,elevationSource:s,cameraHeight:n,cameraHeading:l},elevationSample:c}=this.currentBestFeature;let u=a.clone();const h=await N(n,{elevationSample:c,elevationSource:s});this.currentBestFeature.elevationSample=h.elevationSample;let p,m=await D(Array.isArray(e)?e:[e],h);if(a.spatialReference.isGeographic)if(a.spatialReference.isWGS84&&4===o?.type){const{latitude:e,longitude:r,ellipsoidRadius:i,squaredEccentricity:s}=o;u=new Ie(K(a.toArray(),[e,r,i,s]),{wkid:0}),m=await Promise.all(m.map((async a=>new Ie(K((await A(a,Pe.WGS84,t)).toArray(),[e,r,i,s]),{wkid:0}))))}else u=await A(u,Pe.WebMercator,t);if(m=await Promise.all(m.map((async e=>u.spatialReference.equals(e.spatialReference)?e:await A(e,u.spatialReference,t)))),y(t),"panoramic"===this.mode)p=Y(m,{imageHeight:i[1],imageWidth:i[0],cameraHeading:l,cameraLocation:a});else{const e=Q(this.currentBestFeature.attributes,i);p=Z(m,e)}return Array.isArray(e)?p:p[0]}updateCurrentCoveragePolygon(e){const{additionalFootprints:r,additionalCameraLocations:i,currentBestFeature:a,currentBestFeatureLocation:o,currentCoverageVisible:s,selectedPoint:n,view:l,_adapter:c}=this,{attributes:{objectId:u},elevationSample:h}=a;if(this._initialCurrentCoverageUpdate){if(this._overlays?.removeAll(),this._initialCurrentCoverageUpdate=!1,this.bestFeatureCurrentFootprint=d(this.bestFeatureCurrentFootprint),e&&!this.invalidCameraHeading&&(e.visible=s,this.bestFeatureCurrentFootprint=e),l){const e=[...r,...i,this.bestFeatureCurrentFootprint,o].filter(we);l.supportsGround&&h&&c?.updateGroundElevation&&c.updateGroundElevation(e,h),n&&e.push(new t({geometry:n.clone(),symbol:le.clone(),attributes:{imageID:u}})),this._overlays.graphics.addMany(e)}}else if(l){if(this.invalidCameraHeading)return;this.bestFeatureCurrentFootprint&&(this._overlays?.remove(this.bestFeatureCurrentFootprint),this.bestFeatureCurrentFootprint=d(this.bestFeatureCurrentFootprint));const t=this.bestFeatureCurrentFootprint&&this._overlays?this._overlays.graphics.indexOf(this.bestFeatureCurrentFootprint):-1;e&&(this.bestFeatureCurrentFootprint=e,l?.supportsGround&&h&&c?.updateGroundElevation&&c.updateGroundElevation([e],h),e.visible=this.currentCoverageVisible,this._overlays?.graphics.add(this.bestFeatureCurrentFootprint,t>=0?t:this._overlays.graphics.length-1))}}};e([C()],Be.prototype,"activeLayer",null),e([C({readOnly:!0})],Be.prototype,"activeViewer",null),e([C()],Be.prototype,"additionalFeatures",void 0),e([C({type:o.ofType(t)})],Be.prototype,"additionalCameraLocations",void 0),e([C({type:o.ofType(t)})],Be.prototype,"additionalFootprints",void 0),e([C()],Be.prototype,"bestFeatureAngle",void 0),e([C()],Be.prototype,"bestFeatureCurrentFootprint",void 0),e([C({type:t})],Be.prototype,"bestFeatureFootprint",void 0),e([C({type:Number})],Be.prototype,"brightness",null),e([C({type:Number})],Be.prototype,"contrast",null),e([C()],Be.prototype,"coverageFrustums",void 0),e([C()],Be.prototype,"coveragePolygons",void 0),e([C()],Be.prototype,"currentBestFeature",void 0),e([C()],Be.prototype,"currentBestFeatureLocation",void 0),e([C()],Be.prototype,"currentCoverageVisible",void 0),e([C({json:{write:!1}})],Be.prototype,"determineWorkflowForFeature",void 0),e([C()],Be.prototype,"disabled",void 0),e([C()],Be.prototype,"displayMessage",void 0),e([C()],Be.prototype,"drawFootprint",void 0),e([C({readOnly:!0})],Be.prototype,"featureCount",null),e([C()],Be.prototype,"features",void 0),e([C({readOnly:!0})],Be.prototype,"imageGalleryEnabled",null),e([C({readOnly:!0})],Be.prototype,"imageLoaded",null),e([C({readOnly:!0})],Be.prototype,"invalidCameraHeading",null),e([C()],Be.prototype,"imagePointsInView",null),e([C()],Be.prototype,"isAdditionalCoverageVisible",void 0),e([C()],Be.prototype,"isAdditionalPointSourcesVisible",void 0),e([C()],Be.prototype,"layer",void 0),e([C()],Be.prototype,"layerView",null),e([C({readOnly:!0})],Be.prototype,"layerFloorFilterClause",null),e([C({type:Number})],Be.prototype,"localPort",void 0),e([C()],Be.prototype,"mapImageConversionToolState",void 0),e([C({readOnly:!0,value:"none"})],Be.prototype,"mode",null),e([C()],Be.prototype,"navigatorCurrentBestFeature",void 0),e([C({type:o.ofType(t)})],Be.prototype,"overlayedCameraLocations",void 0),e([C()],Be.prototype,"overlayedMapFeatures",void 0),e([C()],Be.prototype,"pointSources",void 0),e([C({readOnly:!0})],Be.prototype,"popupEnabled",null),e([C()],Be.prototype,"previousFeatureAngle",void 0),e([C()],Be.prototype,"referencePoint",null),e([C({readOnly:!0})],Be.prototype,"sectorData",null),e([C()],Be.prototype,"selectedPoint",void 0),e([C({type:Number})],Be.prototype,"sharpness",null),e([C()],Be.prototype,"shouldShowSelectedImage",void 0),e([C({readOnly:!0})],Be.prototype,"state",null),e([C({readOnly:!0})],Be.prototype,"thumbnails",null),e([C()],Be.prototype,"updateFootprint",void 0),e([C()],Be.prototype,"updateFootprintPanorama",void 0),e([C({value:null})],Be.prototype,"view",null),e([C()],Be.prototype,"_adapter",void 0),e([C()],Be.prototype,"_highlightedFeatureHandle",void 0),e([C()],Be.prototype,"_imageViewer",void 0),e([C()],Be.prototype,"_initialCurrentCoverageUpdate",void 0),e([C()],Be.prototype,"_overlays",void 0),e([C({readOnly:!0})],Be.prototype,"_overlaysView",null),e([C()],Be.prototype,"_panoramicViewer",void 0),e([C()],Be.prototype,"_referencePointOnGround",void 0),e([C()],Be.prototype,"_referencePointOnImage",void 0),e([C()],Be.prototype,"_sectorData",void 0),e([C({readOnly:!0})],Be.prototype,"_updatingHandles",void 0),e([C()],Be.prototype,"footprintExtent",void 0),Be=e([S("esri.widgets.OrientedImageryViewer.OrientedImageryViewerViewModel")],Be);const Re=Be;export{Re as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import"../../geometry.js";import t from"../../Graphic.js";import"../../symbols.js";import{isSome as r,equals as i}from"../../core/arrayUtils.js";import{createTask as a}from"../../core/asyncUtils.js";import o from"../../core/Collection.js";import{deprecatedProperty as s}from"../../core/deprecate.js";import n from"../../core/Error.js";import l from"../../core/Evented.js";import{isSerializable as c}from"../../core/JSONSupport.js";import{equalsShallow as u}from"../../core/lang.js";import h from"../../core/Logger.js";import{clamp as p}from"../../core/mathUtils.js";import{abortMaybe as m,destroyMaybe as d}from"../../core/maybe.js";import{EsriPromise as g}from"../../core/Promise.js";import{throwIfAborted as y,isAbortError as f,waitTick as v}from"../../core/promiseUtils.js";import w from"../../core/ReactiveMap.js";import{on as F,watch as b,syncAndInitial as _,initial as P}from"../../core/reactiveUtils.js";import{sqlAnd as I}from"../../core/sql.js";import{property as C}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as S}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as V}from"../../core/support/UpdatingHandles.js";import{union as A}from"../../geometry/geometryEngineAsync.js";import{projectWithZConversion as j}from"../../geometry/projection.js";import{isClockwise as M}from"../../geometry/support/coordsUtils.js";import{isPolygon as O}from"../../geometry/support/jsonUtils.js";import{geographicToWebMercator as k}from"../../geometry/support/webMercatorUtils.js";import B from"../../layers/GraphicsLayer.js";import{searchImages as L}from"../../layers/orientedImagery/queries.js";import{calculateSuitabilities as G}from"../../layers/orientedImagery/core/bestImageUtils.js";import{createCoveragePolygon as R,computePolygonForInspection as x,resizePolygon as E,checkIfPolygonContainsSelectedPoint as H}from"../../layers/orientedImagery/core/coverageUtils.js";import{isElevationSource as T}from"../../layers/orientedImagery/core/ElevationSourceDefinitions.js";import{imageToWorld as D,imageToWorldPanoramic as z}from"../../layers/orientedImagery/transformations/imageToWorld.js";import U from"../../layers/orientedImagery/transformations/updateElevation.js";import{getElevationSampler as W}from"../../layers/orientedImagery/transformations/updateElevationUtils.js";import{getInitialAngle as N,convertPixelToHeadingPitch as q,getUpdateElevationProps as $,isElevationSampler as J,getImageToWorldProperties as K,getImageToWorldPanoramicProperties as Q,geographicToLTP as X,getWorldToImageProperties as Y,convertHeadingPitchToSphereVertex as Z}from"../../layers/orientedImagery/transformations/utils.js";import{worldToImagePanoramic as ee,worldToImage as te}from"../../layers/orientedImagery/transformations/worldToImage.js";import{getFloorFilterClause as re}from"../../layers/support/floorFilterUtils.js";import ie from"../../rest/support/AttachmentQuery.js";import{scale as ae}from"../../views/draw/support/drawUtils.js";import{ViewEventPriorities as oe}from"../../views/input/InputManager.js";import se from"../PanoramicViewer.js";import{invalidCameraHeading as ne,sectorsInOrder as le,sectorsRadii as ce}from"./constants.js";import{crossSymbol as ue,crossSymbol3D as he,sourcePointSymbol as pe,diamondSymbol as me,diamondSymbol3D as de,activeSourcePointSymbol as ge}from"./symbols.js";import{isNoAttachmentError as ye,getContentType as fe,isTifOrMrf as ve,filterOILLayerView as we,isSceneView as Fe,isGraphic as be,calculateSegment as _e,calculateDirection as Pe}from"./utils.js";import Ie from"./components/ImageViewer.js";import Ce from"../../geometry/Point.js";import Se from"../../geometry/SpatialReference.js";import Ve from"../../symbols/SimpleLineSymbol.js";import Ae from"../../geometry/Multipoint.js";import je from"../../geometry/Polyline.js";import Me from"../../geometry/Polygon.js";const Oe={click:"view-click",imageClick:"image-click",interactionHandles:"interaction-handles",footprintHandles:"footprint-handles"},ke=new Set(["JPG","JPEG"]),Be=/\.(\w+)$/,Le=e=>"FA"===e;let Ge=class extends(l.EventedMixin(g)){constructor(e){super(e),this.additionalFeatures=new o,this.additionalCameraLocations=new o,this.additionalFootprints=new o,this.bestFeatureAngle=0,this.bestFeatureCurrentFootprint=null,this.bestFeatureFootprint=null,this.coverageFrustums=new o,this.coveragePolygons=new o,this.currentBestFeature=null,this.currentBestFeatureLocation=null,this.currentCoverageVisible=!0,this.determineWorkflowForFeature=()=>{m(this._featureChangedTask),this._featureChangedTask=a((async e=>{const{currentBestFeature:t,selectedPoint:r,view:i}=this;if(i?.closePopup(),t&&r){this._initialCurrentCoverageUpdate=!0;try{await this._updatePointsAndPolygons({signal:e}),await this._loadImage({signal:e})}catch(a){f(a)||(this.loadImageError(a),h.getLogger(this).error("#loadIImage()","error occured while loading image",a))}}}))},this.disabled=!1,this.displayMessage={key:"onLoadMessage",type:"info"},this.drawFootprint=()=>{this.bestFeatureFootprint&&this.updateCurrentCoveragePolygon(this.bestFeatureFootprint)},this.features=new o,this.isAdditionalCoverageVisible=!1,this.isAdditionalPointSourcesVisible=!1,this.layer=null,this.localPort=null,this.mapImageConversionToolState=!1,this.navigatorCurrentBestFeature=null,this.overlayedCameraLocations=new o,this.overlayedMapFeatures=new w,this.pointSources=new o,this.previousFeatureAngle=0,this.selectedPoint=null,this.shouldShowSelectedImage=!1,this.updateFootprint=async(e,t)=>{"image-loaded"===this.state&&await(this._adapter?.updateFootprint(e,t))},this.updateFootprintPanorama=async(e,t)=>{await(this._adapter?.updateFootprintPanorama(e,t))},this._adapter=null,this._highlightedFeatureHandle=null,this._imageViewer=new Ie,this._initialCurrentCoverageUpdate=!0,this._overlays=new B({listMode:"hide",internal:!0,elevationInfo:{mode:"absolute-height"}}),this._panoramicViewer=new se,this._referencePointOnGround=null,this._referencePointOnImage=null,this._sectorData=null,this._updatingHandles=new V,this._clickTask=null,this._crossSymbol=null,this.footprintExtent=null,this._featureChangedTask=null,this._openPopupTask=null,this._suitabilities=null,this._transformController=new AbortController,this._updateFootprintTask=null,this.highlight=e=>{if(!this._overlaysView)return;this.removeHighlight();const t=this.additionalFootprints.find((({attributes:{imageID:t}})=>t===Number(e)));this._highlightedFeatureHandle=t?this._overlaysView?.highlight(t):null},this.loadImageFromSource=async(e,t)=>this._updatingHandles.addPromise(this._loadImageFromSourceInternal(e,t)),this.loadImageViewer=e=>{this._imageViewer.container=e},this.loadPanoramicViewer=e=>{this._panoramicViewer.container=e},this.removeHighlight=()=>this._highlightedFeatureHandle?.remove(),this.toggleImageAttributes=()=>{m(this._openPopupTask),this._openPopupTask=a((async e=>{const{currentBestFeature:r,popupEnabled:i,layer:a,view:o}=this;if(o?.closePopup(),!(o&&r&&i&&a))return;const{attributes:s,geometry:n}=r,l=new t({geometry:n,attributes:s.toJSON(),layer:a});y(e),await o.openPopup({features:[l],location:s.location.clone()})}))},this._createViewClickHandle=()=>{if(this.removeHandles(Oe.click),"disabled"===this.state||null==this.view)return;const e=this.mapImageConversionToolState&&"image-loaded"===this.state?this._mapImageConversionToolViewClickHandler:this._viewClickHandler;this.addHandles(this.view.on("click",e,oe.WIDGET),Oe.click)},this._createImageClickHandle=()=>{this.removeHandles(Oe.imageClick);const{mapImageConversionToolState:e,mode:t,activeViewer:r,currentBestFeature:i,footprintExtent:o}=this,s=r?.imageSize;if(!(e&&"none"!==t&&s&&o&&i))return;r.clickAction="pixel-location";let n=null;const l=F((()=>r),"pixel-location",(e=>{this.plotReferencePointOnImage(e),n?.abort(),n=a((async r=>{if(!e)return;const a=await this.getMapPoint(e,{feature:i,imageSize:s,mode:t});y(r),this.plotReferencePointOnGround(a)}))}));this.addHandles(l,Oe.imageClick)},this._getImageSourceFromAttachment=async(e,t,r)=>{const i=new ie({objectIds:[t]}),a=await e.queryAttachments(i,r),o=a[`${t}`]?.[0],s=o?.url;if(!s)throw new n("NoAttachmentError","no attachments found",{[e.objectIdField]:t,layer:e});return{datasetFormat:o.contentType.split("/")[1].toUpperCase(),url:s}},this._loadAdapter=async e=>{const{view:t}=this;if(t)switch(t.type){case"2d":{const{default:t}=await import("./adapters/OrientedImageryViewerViewModelAdapter2D.js");y(e),this._adapter=new t(this);break}case"3d":{const{default:t}=await import("./adapters/OrientedImageryViewerViewModelAdapter3D.js");y(e),this._adapter=new t(this);break}}else this._adapter=null},this._loadImage=async e=>{const{currentBestFeature:t,layer:r,mode:i}=this;if(this.clearGraphics(),!r||!t||"none"===i)return;const{attributes:a}=t,{imagePath:o,imageRotation:s,cameraHeading:n,cameraRoll:l,cameraPitch:c,objectId:u,cameraOrientation:p,location:m}=a,d=(l??0)+(s??0),g=m.spatialReference.isWGS84&&4!==p?.type?k(m):new Ce(m);let v=o;if(Le(o))try{v=await this._getImageSourceFromAttachment(r,u,e)}catch(w){if(f(w))return;return ye(w)?(h.getLogger(this).error(w),void this.setMessage("noAttachment","error",`${r.objectIdField}: ${u}`)):(h.getLogger(this).error(w,{[r.objectIdField]:u,layer:r}),void this.setMessage("imageLoadError","error",`query-attachments-failed:${r.objectIdField} ${u}`))}try{await this.loadImageFromSource(v,{imageRotation:d,options:e,pitch:c,yaw:n,mode:i,cameraLocation:g}),y(e),await this.transformAndPlotSelectedLocation(e)}catch(w){f(w)||this.loadImageError(w)}},this._loadImageFromSourceInternal=async(e,t)=>{const{mode:r,imageRotation:i,options:a}=t,o="string"==typeof e,s=o?e:e.url,{origin:n,pathname:l,searchParams:c}=new URL(s);let u=o?l.match(Be)?.[1]??"":e.datasetFormat;if(!u){const e=await fe(s,{...t.options});e&&(u=e.split("/")[1]),u??="UNKNOWN FORMAT"}switch(r){case"default":this._imageViewer.imageSource={datasetFormat:u.toUpperCase(),url:`${n}${l}`},this._imageViewer.customParameters=Object.fromEntries(c),this._imageViewer.imageRotation=i??0,await this._imageViewer.loadImage(a);break;case"panoramic":if(ke.has(u.toUpperCase())){const{selectedPoint:e}=this,{pitch:r,yaw:i,cameraLocation:o,viewAngle:n}=t;this._panoramicViewer.imageSource=s;let l=i??0;"number"==typeof n?l=n-l:o&&e&&(l=await N(o,e)-l),this._panoramicViewer.pitch=r??0,this._panoramicViewer.yaw=l,await this._panoramicViewer.loadImage(a)}else this.setMessage("unsupportedPanoramicImageryError","error",void 0,{datasetFormat:u});break}},this._mapImageConversionToolViewClickHandler=e=>{e.stopPropagation(),e.preventDefault(),e.mapPoint&&this.plotMapPoint(e.mapPoint)},this._viewClickHandler=e=>{this._clickTask?.abort(),this._clickTask=a((async t=>{const{pointerType:r,button:i,mapPoint:a}=e;if(("mouse"!==r||0===i)&&a)return e.stopPropagation(),e.preventDefault(),this._updatingHandles.addPromise(this.loadBestImage(a,{signal:t}))}))},this.plotSelectedPointOnImage=async(e,r)=>{if(await v(r),!e)return;const i=new Ce({...c(e)?e.toJSON():e});if("default"===this.mode)i.x-=.5,i.y=.5-i.y,i.spatialReference=this._imageViewer.imageRenderer.spatialReference.clone(),this._crossSymbol=new t({geometry:i,symbol:ue}),this._imageViewer.addGraphic(this._crossSymbol,0);else if("panoramic"===this.mode){const{imageSize:r}=this._panoramicViewer;if(!r)return;const[i,a]=r,{heading:o,pitch:s}=q(e,i,a),n=Z(o,s);this._crossSymbol=new t({geometry:new Ce(n,Se.WebMercator),symbol:he}),this._panoramicViewer.addGraphic(this._crossSymbol,0)}},this.handleSectorClick=this.handleSectorClick.bind(this),this.searchBestImage=this.searchBestImage.bind(this),this.transformAndPlotReferencePointOnImage=this.transformAndPlotReferencePointOnImage.bind(this),this.updateSuitabilities=this.updateSuitabilities.bind(this),this.determineWorkflowForFeature=this.determineWorkflowForFeature.bind(this),this.selectBestFeature=this.selectBestFeature.bind(this),this.drawFootprint=this.drawFootprint.bind(this)}initialize(){this.addHandles([b((()=>this.view),(()=>{this.load()}),_),b((()=>this.view?.map),((e,t)=>{t?.layers.remove(this._overlays),e?.layers.add(this._overlays)}),P),b((()=>this.view?.map?.allLayers?.length),(e=>{e&&this.view?.map?.layers.reorder(this._overlays,e-1)}),P),b((()=>[this.state,this.mapImageConversionToolState,this.view]),(()=>{this._createViewClickHandle(),this._createImageClickHandle()}),_),b((()=>this.bestFeatureAngle),((e,t)=>{this.previousFeatureAngle=t??0}),_),b((()=>this.currentBestFeature),((e,t)=>{this.determineWorkflowForFeature(e,t)}),{sync:!0}),b((()=>this.mode),(e=>{switch(this.removeHandles(Oe.interactionHandles),e){case"default":this.addHandles(b((()=>this._imageViewer.imagePointsInView),(e=>{e&&(m(this._updateFootprintTask),this._updateFootprintTask=a((async t=>{await this.updateFootprint(e,{signal:t})})))}),{..._,equals:(e,t)=>i(e,t,u)}),Oe.interactionHandles);break;case"panoramic":this.addHandles(b((()=>{const{currentBestFeature:e,state:t}=this,{imageSize:r,vfov:i,hfov:a,pitch:o,yaw:s}=this._panoramicViewer;return e&&r&&"image-loading"!==t?[i,a,s,o]:null}),(e=>{if(!e||"image-loading"===this.state)return;const[t,r,i,o]=e;m(this._updateFootprintTask),this._updateFootprintTask=a((async e=>{await this.updateFootprintPanorama({verticalFieldOfView:t,horizontalFieldOfView:r,yaw:i,pitch:o},{signal:e})}))}),{..._,equals:(e,t)=>i(e,t,u)}),Oe.interactionHandles)}}),_),b((()=>[this.brightness,this.contrast,this.sharpness]),(()=>{const{_imageViewer:e,brightness:t,contrast:r,mode:i,sharpness:a}=this;"default"===i&&(e.brightness=t,e.contrast=r,e.sharpness=a)}),_)])}destroy(){this._updateFootprintTask=m(this._updateFootprintTask),this._clickTask=m(this._clickTask),this.coverageFrustums.destroy(),this.coveragePolygons.destroy(),this.pointSources.destroy(),this.additionalFootprints.destroy(),this.additionalCameraLocations.destroy(),this.bestFeatureFootprint=d(this.bestFeatureFootprint),this.bestFeatureCurrentFootprint=d(this.bestFeatureCurrentFootprint),this._crossSymbol=d(this._crossSymbol),this._referencePointOnGround=d(this._referencePointOnGround),this._referencePointOnImage=d(this._referencePointOnImage),this._overlays&&this.view?.map?.remove(this._overlays),this._overlays.destroy()}get activeLayer(){return s(h.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer}set activeLayer(e){s(h.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer=e}get activeViewer(){const{_imageViewer:e,_panoramicViewer:t,mode:r}=this;switch(r){case"default":return e;case"panoramic":return t;default:return null}}get brightness(){return this._get("brightness")??0}set brightness(e){this._set("brightness",p(e,-10,10))}get contrast(){return this._get("contrast")??0}set contrast(e){this._set("contrast",p(e,-10,10))}get featureCount(){return this.features?.length??0}get imageGalleryEnabled(){return ve(this.currentBestFeature?.attributes.imagePath.trim())}get imageLoaded(){return s(h.getLogger(this),"imageLoaded",{replacement:'Use OrientedImageryViewer.state === "image-loaded"',version:"4.29",warnOnce:!0}),"image-loaded"===this.state}get invalidCameraHeading(){return this.currentBestFeature?.attributes?.cameraHeading===ne}get imagePointsInView(){const{mode:e,_imageViewer:t}=this;return"default"===e?t.imagePointsInView:null}get layerView(){const{layer:e,view:t}=this;if(e&&t)return t.allLayerViews.find(we(e))}get layerFloorFilterClause(){const{layerView:e}=this;return e?re(e):null}get mode(){const e=this.currentBestFeature?.attributes;if(!e)return"none";const{horizontalFieldOfView:t,isSpherical:r}=e;return 360===t||r?"panoramic":"default"}get popupEnabled(){return!0===this.layer?.popupEnabled}get referencePoint(){return this._referencePointOnGround?.geometry}get sectorData(){const{_sectorData:e}=this;return e?le.map((t=>e[t])):null}get sharpness(){return this._get("sharpness")??0}set sharpness(e){this._set("sharpness",p(e,0,1))}get state(){const{mode:e,disabled:t}=this;if(t)return"disabled";if(!this.isFulfilled())return"loading";if(this.isRejected())return"error";if(this._updatingHandles.updating)return"image-loading";if("error"===this.displayMessage?.type)return"image-load-error";switch(e){case"default":return this._imageViewer.state;case"panoramic":return this._panoramicViewer.state}return"ready"}get thumbnails(){const{features:e}=this;return e?new o(e.map((({attributes:{imagePath:e,objectId:t,cameraRoll:r,imageRotation:i}})=>{const a=e.trim();return ve(a)?{url:a,objectId:t,rotation:(r??0)+(i??0)}:null})).filter(r)):null}set view(e){this._set("view",e)}get _overlaysView(){return this.view?.layerViews.find((({layer:e})=>e===this._overlays))}filterByFootprints(e,t){const r=[],i=[],a=[];return e.forEach((e=>{const{layer:{coveragePercent:o},attributes:s}=e;let n;const{polygon:l,frustum:c}=R(s);if(n=l.clone(),s.isInspection&&(n=x(s)),o&&(n=E(n,o)),H(n,t)){a.push(e);const{geometry:t,objectId:o,cameraHeight:n,cameraHeading:u}=s,h=t.clone();h.z=n,h.imageID=o,this.pointSources.push(h),u!==ne&&(r.push(l),c&&i.push(c))}})),{features:a,polygons:r,frustums:i}}getCurrentCoveragePolygon(){return this.bestFeatureCurrentFootprint}getCurrentBestFeaturePolygon(){return this.bestFeatureFootprint}handleSectorClick(e){if(isNaN(e))return;const t=this._sectorData?.[le[e]];t?.length&&this._updateCurrentBestFeature(t.at(0))}handleFeatureClick(e){const{sector:t,featureIndexInSector:r}=e;if(isNaN(r))return;const i=this._sectorData?.[t];i?.length&&this._updateCurrentBestFeature(i.at(r))}async load(e){return this.addResolvingPromise(this._loadAdapter(e).catch((e=>{if(!f(e))throw e}))),this}async loadBestImage(e,t){return this.view?.closePopup(),this.displayMessage=null,this.selectedPoint=e.spatialReference.isGeographic?k(e):e.clone(),this.features.removeAll(),this.currentBestFeature=null,this.additionalFeatures.removeAll(),this.additionalFootprints.removeAll(),this.additionalCameraLocations.removeAll(),this.bestFeatureCurrentFootprint=d(this.bestFeatureCurrentFootprint),this._overlays?.removeAll(),this._fetchFeaturesWithController(e,t)}loadImageError(e){h.getLogger(this).error("oriented-imagery-viewer:load-image",e),this.setMessage("imageLoadError","error",e.message)}async overlayCameraLocations(e){const{activeViewer:r,currentBestFeature:i,overlayedCameraLocations:a,layer:o,mode:s}=this,n=r?.imageSize;if(!n||!i||!o||"none"===s)return;const{polygon:l}=R(i.attributes);if(r.removeManyGraphics(a.toArray()),a.removeAll(),e){const{features:e}=await o.queryFeatures({where:`${o.objectIdField} <> ${i.attributes.objectId}`,geometry:l,returnGeometry:!0,outFields:[o.objectIdField]}),c=await Promise.all(e.map((async e=>{const{attributes:r,geometry:a}=e,o=await this.getPixels(a,{feature:i,imageSize:n,mode:s}),l=pe.clone();return l.outline=new Ve({color:[0,0,0],width:1}),new t({attributes:r,symbol:l,geometry:o})})));a.addMany(c),r.addManyGraphics(a.toArray())}}overlayGraphicsOnImage(e,t){this.overlayedMapFeatures.set(e,t),this.activeViewer?.addManyGraphics(t.toArray())}async overlayMapFeatures(e){const{activeViewer:i,currentBestFeature:a,mode:s}=this,n=i?.imageSize;if(!n||!a||"none"===s)return;const{polygon:l}=R(a.attributes),{features:c}=await e.queryFeatures({geometry:l,returnGeometry:!0,outFields:[e.objectIdField]}),u=new o((await Promise.all(c.map((async r=>{const{attributes:i,geometry:o}=r,l=r.symbol?.clone()??e.renderer?.getSymbol(r).clone();switch(o?.type){case"point":{const r=await this.getPixels(o,{feature:a,imageSize:n,mode:s});return new t({attributes:i,layer:e,symbol:l,geometry:r,visible:e.visible})}case"polygon":{const{rings:r,spatialReference:c}=o,u=r.map((e=>e.map((([e,t,r])=>new Ce({x:e,y:t,z:r,spatialReference:c}))))),h=await Promise.all(u.map((async e=>this.getPixels(e,{feature:a,imageSize:n,mode:s}).then((e=>e.map((({x:e,y:t})=>[e,t])))))));return new t({attributes:i,layer:e,symbol:l,geometry:new Me({rings:h,spatialReference:Se.WebMercator}),visible:e.visible})}case"polyline":{const{paths:r,spatialReference:c}=o,u=r.flatMap((e=>e.map((([e,t,r])=>new Ce({x:e,y:t,z:r,spatialReference:c}))))),h=await this.getPixels(u,{feature:a,imageSize:n,mode:s});return new t({attributes:i,layer:e,symbol:l,geometry:new je({paths:[h.map((e=>e.toArray()))],spatialReference:Se.WebMercator}),visible:e.visible})}case"multipoint":{const{points:r,spatialReference:c}=o,u=r.map((([e,t,r])=>new Ce({x:e,y:t,z:r,spatialReference:c}))),h=await this.getPixels(u,{feature:a,imageSize:n,mode:s});return new t({attributes:i,layer:e,symbol:l,geometry:new Ae({points:h.map((e=>e.toArray())),spatialReference:Se.WebMercator}),visible:e.visible})}}return null})))).filter(r));this.overlayGraphicsOnImage(`${e.id}`,u)}async getPixels(e,t){const{imageSize:r,mode:i}=t,a=(await this.worldToImage(Array.isArray(e)?e:[e])).map((e=>{if("default"===i)return new Ce({x:e.x-.5,y:.5-e.y,spatialReference:Se.WebMercator});const[t,a]=r,{heading:o,pitch:s}=q(e,t,a),n=Z(o,s);return new Ce(n,Se.WebMercator)}));return Array.isArray(e)?a:a[0]}async getMapPoint(e,t){const{feature:r,mode:i,imageSize:a}=t,{elevationSample:o,attributes:s}=r,{elevationSource:n,location:l,cameraHeight:c}=s;let u=l.clone();u.spatialReference.isGeographic&&(u=await j(u,Se.WebMercator));const h=await $((u.z??0)-c,{elevationSample:o,elevationSource:n,extent:this.footprintExtent});let p;if("elevationSample"in h&&J(h.elevationSample)&&(r.elevationSample=h.elevationSample),"default"===i){const t=K(s,a[0],a[1]);p=await D(Array.isArray(e)?e:[e],{...t,cameraLocation:u},h)}else{const t=Q(s,a[0],a[1]);p=await z(Array.isArray(e)?e:[e],{...t,cameraLocation:u},h)}return Array.isArray(e)?p:p[0]}async plotMapPoint(e){return this.plotReferencePoint(e),this.transformAndPlotReferencePointOnImage({feature:this.currentBestFeature,selectedLocation:e,options:{signal:this._transformController?.signal}})}plotReferencePointOnGround(e){this._referencePointOnGround&&(this._overlays?.remove(this._referencePointOnGround),this._referencePointOnGround.destroy()),null!=e&&(this._referencePointOnGround=new t({geometry:new Ce({...e.toJSON()}),symbol:me}),this.view?this._overlays?.add(this._referencePointOnGround):this.emit("plot-ground-point",{data:{point:this._referencePointOnGround?.geometry}}))}plotReferencePointOnImage(e){if("image-loaded"===this.state)switch(this._referencePointOnImage&&(this._imageViewer.removeGraphic(this._referencePointOnImage),this._panoramicViewer.removeGraphic(this._referencePointOnImage),this._referencePointOnImage.destroy()),this.mode){case"default":{const r=c(e)?e.toJSON():e;r.x-=.5,r.y=.5-r.y,this._referencePointOnImage=new t({geometry:new Ce({spatialReference:this._imageViewer.imageRenderer.spatialReference.clone(),...r}),symbol:me}),this._imageViewer.addGraphic(this._referencePointOnImage,0);break}case"panoramic":{const{imageSize:r}=this._panoramicViewer;if(!r)return;const[i,a]=r,{heading:o,pitch:s}=q(e,i,a),n=Z(o,s);this._referencePointOnImage=new t({geometry:new Ce(n,Se.WebMercator),symbol:de}),this._panoramicViewer.addGraphic(this._referencePointOnImage,0);break}}}removeAllOverlayMapFeatures(){this.overlayedMapFeatures.forEach((e=>{this._imageViewer.removeManyGraphics(e.toArray())})),this.overlayedMapFeatures.clear()}removeOverlayedGraphicsOnImage(e){const t=this.overlayedMapFeatures.get(e);t?.length&&(this.activeViewer?.removeManyGraphics(t.toArray()),this.overlayedMapFeatures.delete(e))}resetImage(){switch(this.setMessage("onLoadMessage","info"),this.mode){case"default":this._imageViewer.clearImage(),this._imageViewer.clearGraphics();break;case"panoramic":this._panoramicViewer.clearGraphics()}this._clickTask=m(this._clickTask)}async searchBestImage(e,t){try{const r=await L(e,t);r&&await this._processFeatureResponse(r,e.point,{signal:t?.signal})}catch(r){f(r)||(this.setMessage("imageLoadError","error",r.message),h.getLogger(this).error("error occurred while finding best image",r))}}selectBestFeature(e){this.currentBestFeature=this.features?.find((({attributes:t})=>t.objectId===Number(e)))}setAdditionalCameraLocationsVisibility(e){this.additionalCameraLocations.forEach((t=>{t.visible=e}))}setAdditionalCoverageVisibility(e){this.additionalFootprints.forEach((t=>{t.visible=e}))}setCurrentCoverageVisibility(e){this.bestFeatureCurrentFootprint&&(this.bestFeatureCurrentFootprint.visible=e),this.currentBestFeatureLocation&&(this.currentBestFeatureLocation.visible=e)}setMapImageConversionToolState(e){this.mapImageConversionToolState=e}toggleAllOverlayMapFeatures(e){this.overlayedMapFeatures.forEach((t=>{this._toggleVisiblity(t,e)}))}toggleOverlayMapFeatures(e,t){const r=this.overlayedMapFeatures.get(e);r&&this._toggleVisiblity(r,t)}async transformAndPlotReferencePointOnImage(e){const{selectedLocation:t,options:r}=e,i=this.bestFeatureFootprint?.geometry,a=O(i)&&i.contains(t),o="mesh"===i?.type&&i?.extent.contains(t);if(!a&&!o)return;const s=await this.worldToImage(t,r);return s?(y(r),this.plotReferencePointOnImage(s),{x:s.x,y:s.y}):void 0}updateSuitabilities(e){e.sort(((e,t)=>e.suitability-t.suitability)),this._suitabilities=e;const t=this._suitabilities.map((({feature:e})=>e));this._initialCurrentCoverageUpdate=!0,this._updateFeatures(t),this._groupFeaturesBySectors()}async _fetchFeatures(e,t){if(!this.view)return;const r=this.layer;if(r){const i={include:r},a=this.view.toScreen(e);if(!a)return;const o=await this.view.hitTest(a,i);return this._processHitTestResults(r,o,t)}}async _fetchFeaturesWithController(e,t){try{await this._fetchFeatures(e,t)}catch(r){if(f(r))return;this.setMessage("imageLoadError","error"),h.getLogger(this).error("error occurred while fetching features",r)}}_groupFeaturesBySectors(){const{_suitabilities:e,additionalFeatures:t,currentBestFeature:r,features:i,invalidCameraHeading:a}=this;if(!e||!t||!r||!i||a)return void(this._sectorData=null);this._sectorData={};for(const c of le)this._sectorData[c]=new o;const s=e.map(((e,t)=>({...e,featureIndex:t})));s.sort(((e,t)=>e.trueSuitability-t.trueSuitability));const n=s.map((({distance:e})=>e)),l=Math.max(...n);s.forEach((e=>{const{distance:t,angle:r,featureIndex:a}=e,o=t/l*ce[2],s=_e(t,l),n=Pe(r);if(!this._sectorData)return;const c=ce[3]+o*Math.sin(r*Math.PI/180),u=ce[3]+o*Math.cos(r*Math.PI/180);let h;const p=i.at(a),m=p===this.currentBestFeature,d=this.currentBestFeature?.attributes.cameraPitch&&this.currentBestFeature?.attributes.cameraPitch<5;if(m&&d)h=-90;else{const e=c-ce[3],t=u-ce[3],r=t/Math.sqrt(e**2+t**2);let i=180*Math.acos(r)/Math.PI;(e<0&&t<0||e<0&&t>0)&&(i*=-1),h=i}const g=""===s?n:`${s}_${n}`;m&&(h===this.bestFeatureAngle?this.previousFeatureAngle=h:this.bestFeatureAngle=h,this.navigatorCurrentBestFeature=d?null:{x:c,y:u,direction:n});const y=this._sectorData[g];y.add({angle:r,featureIndex:a,x:c,y:u,objectID:p.attributes.objectId,sector:g,featureIndexInSector:y.length})}))}async _processFeatureResponse(e,t,r){const{features:i}=e;if(!i?.length)return this.setMessage("noImageError","error"),void(this.currentBestFeature=null);this.coveragePolygons.removeAll(),this.coverageFrustums.removeAll(),this.pointSources.removeAll();const{features:a,polygons:o,frustums:s}=this.filterByFootprints(i,t);if(!a.length)return this.setMessage("noImageError","error"),void(this.currentBestFeature=null);let n;if(this.coveragePolygons.addMany(o),this.coverageFrustums.addMany(s),o[0]){let e=new Me({spatialReference:o[0].spatialReference});for(const r of o)e=await A(e,r);const t=[];for(const{geometry:r}of a)e.contains(r)||t.push([r.x,r.y]);if(t.sort(((e,t)=>+M([e,t]))),e.addRing(t),this.footprintExtent=ae(e.extent,2,2),this.view?.supportsGround)try{n=await this.view.map.ground.createElevationSampler(this.footprintExtent,r)}catch(l){f(l)||h.getLogger(this).error(l)}}if((n||a[0].attributes.elevationSource)&&this.footprintExtent){const e=a[0].attributes.elevationSource;T(e)&&!n&&(n=await W({extent:this.footprintExtent,lod:e.lod,url:e.url,rasterFunction:e.rasterFunction}));const r=await $((a[0].attributes.location.z??0)-a[0].attributes.cameraHeight,{elevationSample:n,elevationSource:e,extent:this.footprintExtent}),[i,...o]=await U([t,...a.map((e=>e.attributes.geometry.clone()))],r);a[0].elevationSample=n??r.elevationSample,t.elevation=i.z,a.forEach(((e,t)=>{e.attributes.elevation=o[t].z}))}a[0].elevationSample&&a.forEach((e=>{e.elevationSample=a[0].elevationSample})),this._suitabilities=G({features:a,selectedPoint:t,camera:Fe(this.view)?this.view.camera:null,currentImage:this.currentBestFeature}),this.updateSuitabilities(this._suitabilities)}async _processHitTestResults(e,t,r){const{screenPoint:i,results:[a]}=t,o="graphic"===a?.type&&this.shouldShowSelectedImage,s=a?.mapPoint??this.view?.toMap(i);if(!s)return;const{layerFloorFilterClause:n}=this,l={layerInstanceOrURL:e,point:s,queryParams:{where:I("1=1",I(e.definitionExpression,n)),maximumDistance:e.maximumDistance,objectIds:o?[a.graphic.getAttribute(e.objectIdField)]:void 0}};await this.searchBestImage(l,r)}_toggleVisiblity(e,t){e.forEach((e=>{e.visible=t}))}_updateFeatures(e){if(!e.length)return this.currentBestFeature=null,void this.additionalFeatures.removeAll();this.features.removeAll(),this.features.addMany(e),e.length>1?this.additionalFeatures.addMany(e.slice(1)):this.additionalFeatures.removeAll(),this.currentBestFeature=e[0]}async _updatePointsAndPolygons(e){const{pointSources:r,currentBestFeature:i,currentCoverageVisible:a,isAdditionalPointSourcesVisible:o}=this;if(i&&(this.additionalFootprints.removeAll(),this.additionalCameraLocations.removeAll(),this.bestFeatureCurrentFootprint&&(this.bestFeatureCurrentFootprint.destroy(),this.bestFeatureCurrentFootprint=null,this.bestFeatureFootprint=null),!this.invalidCameraHeading)){await(this._adapter?.createFootprints(e)),y(e);for(const e of r)e.imageID===i.attributes.objectId?this.currentBestFeatureLocation=new t({attributes:{imageID:e.imageID},geometry:e,symbol:ge,visible:a}):this.additionalCameraLocations.push(new t({attributes:{imageID:e.imageID},geometry:e,symbol:pe,visible:o}))}}_updateCurrentBestFeature(e){if(!e)return;this.currentBestFeature=this.features?.at(e.featureIndex);const t=this.currentBestFeature?.attributes.cameraPitch&&this.currentBestFeature?.attributes.cameraPitch<5;let r;if(t)r=-90;else{const t=e.x-ce[3],i=e.y-ce[3],a=i/Math.sqrt(t**2+i**2);let o=180*Math.acos(a)/Math.PI;(t<0&&i<0||t<0&&i>0)&&(o*=-1),r=o}r===this.bestFeatureAngle?this.previousFeatureAngle=r:this.bestFeatureAngle=r,this.navigatorCurrentBestFeature=t?null:{x:e.x,y:e.y,direction:e.sector.includes("_")?e.sector.split("_")[1]:e.sector}}clearGraphics(){this._imageViewer.clearGraphics(),this._panoramicViewer.clearGraphics()}plotReferencePoint(e){"mapPoint"in e?this.plotReferencePointOnGround(e.mapPoint):this.plotReferencePointOnGround(e)}setMessage(e,t,r,i){this.displayMessage={key:e,type:t,data:r,map:i}}async transformAndPlotSelectedLocation(e){const{currentBestFeature:t,invalidCameraHeading:r,selectedPoint:i,state:a}=this;if(this._crossSymbol&&(this._panoramicViewer.removeGraphic(this._crossSymbol),this._imageViewer.removeGraphic(this._crossSymbol),this._crossSymbol=d(this._crossSymbol)),!i||!t||"image-loaded"!==a||r)return;let o;try{o=await this.worldToImage(i,e),y(e),await this.plotSelectedPointOnImage(o,e)}catch(s){f(s)||h.getLogger(this).error("failed to transform map point to pixel, cross symbol will not be plotted on image",{error:s,selectedPoint:i,feature:t})}}async worldToImage(e,t){const{footprintExtent:r}=this,{imageSize:i}=this.activeViewer;if("none"===this.mode||!this.currentBestFeature||!i||!r)return;const{attributes:{location:a,cameraOrientation:o,elevationSource:s,cameraHeight:n,cameraHeading:l},elevationSample:c}=this.currentBestFeature;let u=a.clone();const h=await $((a.z??0)-n,{elevationSample:c,elevationSource:s});this.currentBestFeature.elevationSample=h.elevationSample;let p,m=await U(Array.isArray(e)?e:[e],h);if(a.spatialReference.isGeographic)if(a.spatialReference.isWGS84&&4===o?.type){const{latitude:e,longitude:r,ellipsoidRadius:i,squaredEccentricity:s}=o;u=new Ce(X(a.toArray(),[e,r,i,s]),{wkid:0}),m=await Promise.all(m.map((async a=>new Ce(X((await j(a,Se.WGS84,t)).toArray(),[e,r,i,s]),{wkid:0}))))}else u=await j(u,Se.WebMercator,t);if(m=await Promise.all(m.map((async e=>u.spatialReference.equals(e.spatialReference)?e:await j(e,u.spatialReference,t)))),y(t),"panoramic"===this.mode)p=ee(m,{imageHeight:i[1],imageWidth:i[0],cameraHeading:l,cameraLocation:u});else{const e=Y(this.currentBestFeature.attributes,i[0],i[1]);p=te(m,{...e,cameraLocation:u})}return Array.isArray(e)?p:p[0]}updateCurrentCoveragePolygon(e){const{additionalFootprints:r,additionalCameraLocations:i,currentBestFeature:a,currentBestFeatureLocation:o,currentCoverageVisible:s,selectedPoint:n,view:l,_adapter:c}=this,{attributes:{objectId:u},elevationSample:h}=a;if(this._initialCurrentCoverageUpdate){if(this._overlays?.removeAll(),this._initialCurrentCoverageUpdate=!1,this.bestFeatureCurrentFootprint=d(this.bestFeatureCurrentFootprint),e&&!this.invalidCameraHeading&&(e.visible=s,this.bestFeatureCurrentFootprint=e),l){const e=[...r,...i,this.bestFeatureCurrentFootprint,o].filter(be);l.supportsGround&&h&&c?.updateGroundElevation&&c.updateGroundElevation(e,h),n&&e.push(new t({geometry:n.clone(),symbol:ue.clone(),attributes:{imageID:u}})),this._overlays.graphics.addMany(e)}}else if(l){if(this.invalidCameraHeading)return;this.bestFeatureCurrentFootprint&&(this._overlays?.remove(this.bestFeatureCurrentFootprint),this.bestFeatureCurrentFootprint=d(this.bestFeatureCurrentFootprint));const t=this.bestFeatureCurrentFootprint&&this._overlays?this._overlays.graphics.indexOf(this.bestFeatureCurrentFootprint):-1;e&&(this.bestFeatureCurrentFootprint=e,l?.supportsGround&&h&&c?.updateGroundElevation&&c.updateGroundElevation([e],h),e.visible=this.currentCoverageVisible,this._overlays?.graphics.add(this.bestFeatureCurrentFootprint,t>=0?t:this._overlays.graphics.length-1))}}};e([C()],Ge.prototype,"activeLayer",null),e([C({readOnly:!0})],Ge.prototype,"activeViewer",null),e([C()],Ge.prototype,"additionalFeatures",void 0),e([C({type:o.ofType(t)})],Ge.prototype,"additionalCameraLocations",void 0),e([C({type:o.ofType(t)})],Ge.prototype,"additionalFootprints",void 0),e([C()],Ge.prototype,"bestFeatureAngle",void 0),e([C()],Ge.prototype,"bestFeatureCurrentFootprint",void 0),e([C({type:t})],Ge.prototype,"bestFeatureFootprint",void 0),e([C({type:Number})],Ge.prototype,"brightness",null),e([C({type:Number})],Ge.prototype,"contrast",null),e([C()],Ge.prototype,"coverageFrustums",void 0),e([C()],Ge.prototype,"coveragePolygons",void 0),e([C()],Ge.prototype,"currentBestFeature",void 0),e([C()],Ge.prototype,"currentBestFeatureLocation",void 0),e([C()],Ge.prototype,"currentCoverageVisible",void 0),e([C({json:{write:!1}})],Ge.prototype,"determineWorkflowForFeature",void 0),e([C()],Ge.prototype,"disabled",void 0),e([C()],Ge.prototype,"displayMessage",void 0),e([C()],Ge.prototype,"drawFootprint",void 0),e([C({readOnly:!0})],Ge.prototype,"featureCount",null),e([C()],Ge.prototype,"features",void 0),e([C({readOnly:!0})],Ge.prototype,"imageGalleryEnabled",null),e([C({readOnly:!0})],Ge.prototype,"imageLoaded",null),e([C({readOnly:!0})],Ge.prototype,"invalidCameraHeading",null),e([C()],Ge.prototype,"imagePointsInView",null),e([C()],Ge.prototype,"isAdditionalCoverageVisible",void 0),e([C()],Ge.prototype,"isAdditionalPointSourcesVisible",void 0),e([C()],Ge.prototype,"layer",void 0),e([C()],Ge.prototype,"layerView",null),e([C({readOnly:!0})],Ge.prototype,"layerFloorFilterClause",null),e([C({type:Number})],Ge.prototype,"localPort",void 0),e([C()],Ge.prototype,"mapImageConversionToolState",void 0),e([C({readOnly:!0,value:"none"})],Ge.prototype,"mode",null),e([C()],Ge.prototype,"navigatorCurrentBestFeature",void 0),e([C({type:o.ofType(t)})],Ge.prototype,"overlayedCameraLocations",void 0),e([C()],Ge.prototype,"overlayedMapFeatures",void 0),e([C()],Ge.prototype,"pointSources",void 0),e([C({readOnly:!0})],Ge.prototype,"popupEnabled",null),e([C()],Ge.prototype,"previousFeatureAngle",void 0),e([C()],Ge.prototype,"referencePoint",null),e([C({readOnly:!0})],Ge.prototype,"sectorData",null),e([C()],Ge.prototype,"selectedPoint",void 0),e([C({type:Number})],Ge.prototype,"sharpness",null),e([C()],Ge.prototype,"shouldShowSelectedImage",void 0),e([C({readOnly:!0})],Ge.prototype,"state",null),e([C({readOnly:!0})],Ge.prototype,"thumbnails",null),e([C()],Ge.prototype,"updateFootprint",void 0),e([C()],Ge.prototype,"updateFootprintPanorama",void 0),e([C({value:null})],Ge.prototype,"view",null),e([C()],Ge.prototype,"_adapter",void 0),e([C()],Ge.prototype,"_highlightedFeatureHandle",void 0),e([C()],Ge.prototype,"_imageViewer",void 0),e([C()],Ge.prototype,"_initialCurrentCoverageUpdate",void 0),e([C()],Ge.prototype,"_overlays",void 0),e([C({readOnly:!0})],Ge.prototype,"_overlaysView",null),e([C()],Ge.prototype,"_panoramicViewer",void 0),e([C()],Ge.prototype,"_referencePointOnGround",void 0),e([C()],Ge.prototype,"_referencePointOnImage",void 0),e([C()],Ge.prototype,"_sectorData",void 0),e([C({readOnly:!0})],Ge.prototype,"_updatingHandles",void 0),e([C()],Ge.prototype,"footprintExtent",void 0),Ge=e([S("esri.widgets.OrientedImageryViewer.OrientedImageryViewerViewModel")],Ge);const Re=Ge;export{Re as default};
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7e3,3069],{39516:(e,t,r)=>{async function i(e,t){const{WhereClause:i}=await Promise.all([r.e(835),r.e(4800)]).then(r.bind(r,50835));return i.create(e,{fieldsIndex:t})}function n(e,t){return"1=1"===e?t??e:"1=1"===t?e??t:null!=e&&""!==e?null!=t&&""!==t?`(${e}) AND (${t})`:e:t}r.d(t,{G:()=>i,m:()=>n})},3330:(e,t,r)=>{r.d(t,{GB:()=>n,Qo:()=>o,Y4:()=>s});var i=r(96285);class n{}function s(e){return e instanceof i.bo?e===n.instance:"unknown"===e?.toString().toLowerCase()}function o(e){return s(e)?n.instance:e}n.instance=new i.oh("Etc/UTC")},13069:(e,t,r)=>{r.d(t,{lk:()=>n,vD:()=>o,yS:()=>s});const i="randomUUID"in crypto;function n(){if(i)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function s(){return`{${n().toUpperCase()}}`}function o(){return`{${n()}}`}},70328:(e,t,r)=>{r.d(t,{BI:()=>_,Ej:()=>m,Hq:()=>u,Ie:()=>v,Jt:()=>w,Ne:()=>f,RF:()=>l,_F:()=>c,aI:()=>T,fA:()=>s,gX:()=>h,hZ:()=>b,iT:()=>a,is:()=>F,qv:()=>I,vI:()=>g,v_:()=>M,vt:()=>n,w1:()=>o});var i=r(5443);function n(e=M){return[e[0],e[1],e[2],e[3],e[4],e[5]]}function s(e,t,r,i,s,o,l=n()){return l[0]=e,l[1]=t,l[2]=r,l[3]=i,l[4]=s,l[5]=o,l}function o(e,t){const r=isFinite(e[2])||isFinite(e[5]);return new i.A(r?{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],zmin:e[2],zmax:e[5],spatialReference:t}:{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],spatialReference:t})}function l(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[3]),e[4]=Math.max(e[4],t[4]),e[5]=Math.max(e[5],t[5])}function a(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[0]),e[4]=Math.max(e[4],t[1]),e[5]=Math.max(e[5],t[2])}function u(e,t,r=0,i=t.length/3){let n=e[0],s=e[1],o=e[2],l=e[3],a=e[4],u=e[5];for(let e=0;e<i;e++)n=Math.min(n,t[r+3*e]),s=Math.min(s,t[r+3*e+1]),o=Math.min(o,t[r+3*e+2]),l=Math.max(l,t[r+3*e]),a=Math.max(a,t[r+3*e+1]),u=Math.max(u,t[r+3*e+2]);e[0]=n,e[1]=s,e[2]=o,e[3]=l,e[4]=a,e[5]=u}function d(e){return e[0]>=e[3]?0:e[3]-e[0]}function p(e){return e[1]>=e[4]?0:e[4]-e[1]}function y(e){return e[2]>=e[5]?0:e[5]-e[2]}function c(e){const t=d(e),r=y(e),i=p(e);return Math.sqrt(t*t+r*r+i*i)}function h(e,t=[0,0,0]){return t[0]=e[0]+d(e)/2,t[1]=e[1]+p(e)/2,t[2]=e[2]+y(e)/2,t}function m(e,t=[0,0,0]){return t[0]=d(e),t[1]=p(e),t[2]=y(e),t}function f(e,t,r=e){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r!==e&&(r[3]=e[3],r[4]=e[4],r[5]=e[5]),r}function g(e,t,r=e){return r[3]=t[0],r[4]=t[1],r[5]=t[2],r!==e&&(r[0]=e[0],r[1]=e[1],r[2]=e[2]),e}function b(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function v(e){return e?b(e,I):n(I)}function w(e,t){return e[0]=t[0],e[1]=t[1],e[2]=Number.NEGATIVE_INFINITY,e[3]=t[2],e[4]=t[3],e[5]=Number.POSITIVE_INFINITY,e}function _(e,t,r,i,n){return e[0]=t,e[1]=r,e[2]=Number.NEGATIVE_INFINITY,e[3]=i,e[4]=n,e[5]=Number.POSITIVE_INFINITY,e}function F(e){return 6===e.length}function T(e,t,r){if(null==e||null==t)return e===t;if(!F(e)||!F(t))return!1;if(r){for(let i=0;i<e.length;i++)if(!r(e[i],t[i]))return!1}else for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}r(19419);const I=[1/0,1/0,1/0,-1/0,-1/0,-1/0],M=[0,0,0,0,0,0];n()},70048:(e,t,r)=>{r.r(t),r.d(t,{default:()=>ve});var i=r(90237),n=r(69540),s=r(5503),o=r(49186),l=r(81583),a=r(92071),u=r(74887),d=r(36708),p=r(39516),y=r(84952),c=r(10107),h=(r(44208),r(53966)),m=(r(87811),r(36005)),f=r(40608),g=r(4146),b=r(52136),v=r(18768),w=r(63074),_=r(69208),F=r(47685),T=r(87796),I=r(16131),M=r(8303),S=r(54310),x=r(25036),A=r(82935),O=r(60694),E=r(10873),j=r(15426),N=r(17036),V=r(30524),C=r(13874),$=r(86162),L=(r(94409),r(65345),r(42980),r(20917),r(92438)),D=r(96576),R=r(93618),q=(r(65494),r(4902)),P=r(4718),U=r(92474),G=r(93637),B=r(43937),k=r(90360),Z=r(9582),J=r(16930),X=r(29005),z=r(81457),H=r(39383),Y=r(61956),Q=r(30291),K=r(59868);const W={key:"type",base:L.A,errorContext:"renderer",typeMap:{simple:D.A,"unique-value":R.A,"class-breaks":$.A}},ee=(0,N.p)(),te=(0,k.C)({types:W});let re=0;function ie(e){const t=e.json.write;return"object"==typeof t?t.ignoreOrigin=!0:e.json.write={ignoreOrigin:!0},e}function ne(e){switch(e){case"point":case"multipoint":return K.UK.clone();case"polyline":return K.A7.clone();case"polygon":case"multipatch":return K.Cx.clone();default:return null}}function se(e,t){return null==e?null:t.subtypes?.find((t=>t.code===e))}function oe(e,t){let r=null;switch(t.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":r="point";break;case"esriGeometryPolyline":r="line";break;case"esriGeometryPolygon":case"esriGeometryMultiPatch":r="polygon";break;default:t.type,r=null}const i={},n=se(e,t);if(null!=n){const{defaultValues:e}=n;for(const t in e)i[t]=e[t]}return i[t.subtypeField]=e,new X.A({name:"New Feature",drawingTool:r,prototype:{attributes:i}})}let le=class extends((0,a.P)((0,n.O)((0,q.sA)(U.A)))){constructor(e){super(e),this.charts=null,this.editingEnabled=!0,this.fieldOverrides=null,this.fieldsIndex=null,this.formTemplate=null,this.id=`${Date.now().toString(16)}-subtype-sublayer-${re++}`,this.type="subtype-sublayer",this.labelsVisible=!0,this.labelingInfo=null,this.layerType="ArcGISFeatureLayer",this.legendEnabled=!0,this.listMode="show",this.minScale=0,this.maxScale=0,this.opacity=1,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.subtypeCode=null,this.templates=null,this.title=null,this.visible=!0}load(e){return(0,V.yp)(this.renderer,this.fieldsIndex),Promise.resolve(this)}get capabilities(){return this.parent?.capabilities}get effectiveCapabilities(){return this.parent?.effectiveCapabilities}get effectiveEditingEnabled(){const{parent:e}=this;return e?e.effectiveEditingEnabled&&this.editingEnabled:this.editingEnabled}get elevationInfo(){return this.parent?.elevationInfo}writeFieldOverrides(e,t,r){const{fields:i,parent:n}=this;let s;if(i){s=[];let e=0;i.forEach((({name:t,alias:r,editable:i,visible:o})=>{if(!o)return;const l=n?.fields?.find((e=>e.name===t));if(!l)return;const a={name:t};let u=!1;r!==l.alias&&(a.alias=r,u=!0),i!==l.editable&&(a.editable=i,u=!0),s.push(a),u&&e++})),0===e&&s.length===i.length&&(s=null)}else s=(0,P.o8)(e);s?.length&&(0,G.sM)(r,s,t)}get fields(){const{parent:e,fieldOverrides:t,subtypeCode:r}=this,i=e?.fields;if(!e||!i?.length)return null;const{subtypes:n,subtypeField:s}=e,o=n?.find((e=>e.code===r)),l=o?.defaultValues,a=o?.domains,u=[];for(const e of i){const i=e.clone(),{name:n}=i,o=t?.find((e=>e.name===n));if(i.visible=!t||!!o,o){const{alias:e,editable:t}=o;e&&(i.alias=e),!1===t&&(i.editable=!1)}const d=l?.[n]??null;i.defaultValue=n===s?r:d;const p=a?.[n]??null;i.domain=n===s?null:p?"inherited"===p.type?i.domain:p.clone():null,u.push(i)}return u}get floorInfo(){return this.parent?.floorInfo}get geometryType(){return this.parent?.geometryType}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}get objectIdField(){return this.parent||h.A.getLogger(this).error(de("objectIdField")),this.parent?.objectIdField}get defaultPopupTemplate(){return this.createPopupTemplate()}get relationships(){return this.parent?.relationships}set renderer(e){(0,V.yp)(e,this.fieldsIndex),this._override("renderer",e)}get renderer(){if(this._isOverridden("renderer"))return this._get("renderer");const{parent:e}=this;return e&&!e.isTable&&"mesh"!==e.geometryType?function(e){return new D.A({symbol:ne(e)})}(e.geometryType):null}readRendererFromService(e,t,r){if("Table"===t.type)return null;const i=t.drawingInfo?.renderer,n=te(i,t,r);let s;const{subtypeCode:o}=this;if(null!=o&&function(e,t){return!(!t||"unique-value"!==e?.type||null==e.field||e.field.toLowerCase()!==t.toLowerCase()||e.field2||e.field3||e.valueExpression)}(n,t.subtypeField)){const e=n.uniqueValueInfos?.find((({value:e})=>(e="number"==typeof e?String(e):e)===String(o)));e&&(s=new D.A({symbol:e.symbol}))}else"simple"!==n?.type||n.visualVariables?.length||(s=n);return s}readRenderer(e,t,r){const i=t?.layerDefinition?.drawingInfo?.renderer;if(!i)return;const n=i.visualVariables?.some((e=>"rotationInfo"!==e.type));return n?void 0:te(i,t,r)||void 0}get spatialReference(){return this.parent?.spatialReference??J.A.WGS84}get subtypeField(){return this.parent?.subtypeField}readTemplatesFromService(e,t){return[oe(this.subtypeCode,t)]}readTitleFromService(e,t){const r=se(this.subtypeCode,t);return null!=r?r.name:null}get url(){return this.parent?.url}get userHasUpdateItemPrivileges(){return!!this.parent?.userHasUpdateItemPrivileges}async addAttachment(e,t){const{parent:r}=this;if(!r)throw de("addAttachment");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new o.A("subtype-sublayer:addAttachment","The feature provided does not belong to this SubtypeSublayer");return r.addAttachment(e,t)}async updateAttachment(e,t,r){const{parent:i}=this;if(!i)throw de("updateAttachment");if(e.getAttribute(i.subtypeField)!==this.subtypeCode)throw new o.A("subtype-sublayer:updateAttachment","The feature provided does not belong to this SubtypeSublayer");return i.updateAttachment(e,t,r)}async deleteAttachments(e,t){const{parent:r}=this;if(!r)throw de("deleteAttachments");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new o.A("subtype-sublayer:deleteAttachments","The feature provided does not belong to this SubtypeSublayer");return r.deleteAttachments(e,t)}async applyEdits(e,t){if(!this.parent)throw de("applyEdits");return this.parent.applyEdits(e,t)}createPopupTemplate(e){let t=this;const{parent:r,fields:i,title:n}=this;if(r){const{displayField:e,editFieldsInfo:s,objectIdField:o}=r;t={displayField:e,editFieldsInfo:s,fields:i,objectIdField:o,title:n}}return(0,Q.tn)(t,e)}createQuery(){if(!this.parent)throw de("createQuery");const e=(0,j.VZ)(this.parent),t=`${this.parent.subtypeField}=${this.subtypeCode}`;return e.where=(0,p.m)(t,this.parent.definitionExpression),e}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){return this._getLayerDomain(e)}async queryAttachments(e,t){const r=await this.load();if(!r.parent)throw de("queryAttachments");const i=e.clone();return i.where=ue(i.where,r.parent.subtypeField,r.subtypeCode),r.parent.queryAttachments(e,t)}async queryFeatureCount(e,t){const r=await this.load();if(!r.parent)throw de("queryFeatureCount");return r.parent.queryFeatureCount(ae(r.parent,r,e),t)}async queryFeatures(e,t){const r=await this.load();if(!r.parent)throw de("queryFeatures");return r.parent.queryFeatures(ae(r.parent,r,e),t)}async queryObjectIds(e,t){const r=await this.load();if(!r.parent)throw de("queryObjectIds");return r.parent.queryObjectIds(ae(r.parent,r,e),t)}async queryRelatedFeatures(e,t){const r=await this.load();if(!r.parent)throw de("queryRelatedFeatures");return r.parent.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){const r=await this.load();if(!r.parent)throw de("queryRelatedFeaturesCount");return r.parent.queryRelatedFeaturesCount(e,t)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}};(0,i._)([(0,c.M)({readOnly:!0,json:{read:!1}})],le.prototype,"capabilities",null),(0,i._)([(0,c.M)({readOnly:!0,json:{read:!1}})],le.prototype,"effectiveCapabilities",null),(0,i._)([(0,c.M)({json:{write:{ignoreOrigin:!0}}})],le.prototype,"charts",void 0),(0,i._)([(0,c.M)({type:Boolean,nonNullable:!0,json:{name:"enableEditing",write:{ignoreOrigin:!0}}})],le.prototype,"editingEnabled",void 0),(0,i._)([(0,c.M)({type:Boolean,readOnly:!0})],le.prototype,"effectiveEditingEnabled",null),(0,i._)([(0,c.M)({readOnly:!0,json:{read:!1}})],le.prototype,"elevationInfo",null),(0,i._)([(0,c.M)({json:{name:"layerDefinition.fieldOverrides",origins:{service:{read:!1}},write:{ignoreOrigin:!0,allowNull:!0}}})],le.prototype,"fieldOverrides",void 0),(0,i._)([(0,B.K)("fieldOverrides")],le.prototype,"writeFieldOverrides",null),(0,i._)([(0,c.M)({...ee.fields,readOnly:!0,json:{read:!1}})],le.prototype,"fields",null),(0,i._)([(0,c.M)(ee.fieldsIndex)],le.prototype,"fieldsIndex",void 0),(0,i._)([(0,c.M)({readOnly:!0,json:{read:!1}})],le.prototype,"floorInfo",null),(0,i._)([(0,c.M)({type:Z.A,json:{name:"formInfo",write:{ignoreOrigin:!0}}})],le.prototype,"formTemplate",void 0),(0,i._)([(0,c.M)({type:String,clonable:!1,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],le.prototype,"id",void 0),(0,i._)([(0,c.M)({readOnly:!0,json:{read:!1}})],le.prototype,"geometryType",null),(0,i._)([(0,c.M)({readOnly:!0,json:{read:!1}})],le.prototype,"type",void 0),(0,i._)([(0,c.M)(ie((0,P.o8)(E.kF)))],le.prototype,"labelsVisible",void 0),(0,i._)([(0,c.M)({type:[z.A],json:{name:"layerDefinition.drawingInfo.labelingInfo",origins:{service:{read:!1}},read:{reader:H.w},write:{ignoreOrigin:!0}}})],le.prototype,"labelingInfo",void 0),(0,i._)([(0,c.M)({type:["ArcGISFeatureLayer"],readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],le.prototype,"layerType",void 0),(0,i._)([(0,c.M)(ie((0,P.o8)(E.fV)))],le.prototype,"legendEnabled",void 0),(0,i._)([(0,c.M)({type:["show","hide"]})],le.prototype,"listMode",void 0),(0,i._)([(0,c.M)((()=>{const e=(0,P.o8)(E.hn);return e.json.origins.service.read=!1,ie(e)})())],le.prototype,"minScale",void 0),(0,i._)([(0,c.M)((()=>{const e=(0,P.o8)(E.hG);return e.json.origins.service.read=!1,ie(e)})())],le.prototype,"maxScale",void 0),(0,i._)([(0,c.M)({readOnly:!0})],le.prototype,"effectiveScaleRange",null),(0,i._)([(0,c.M)({readOnly:!0,json:{read:!1}})],le.prototype,"objectIdField",null),(0,i._)([(0,c.M)({type:Number,range:{min:0,max:1},nonNullable:!0,json:{write:{ignoreOrigin:!0}}})],le.prototype,"opacity",void 0),(0,i._)([(0,c.M)({clonable:!1})],le.prototype,"parent",void 0),(0,i._)([(0,c.M)(ie((0,P.o8)(E.M6)))],le.prototype,"popupEnabled",void 0),(0,i._)([(0,c.M)({type:C.A,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],le.prototype,"popupTemplate",void 0),(0,i._)([(0,c.M)({readOnly:!0})],le.prototype,"defaultPopupTemplate",null),(0,i._)([(0,c.M)({readOnly:!0,json:{read:!1}})],le.prototype,"relationships",null),(0,i._)([(0,c.M)({types:W,json:{write:{target:"layerDefinition.drawingInfo.renderer",ignoreOrigin:!0}}})],le.prototype,"renderer",null),(0,i._)([(0,m.w)("service","renderer",["drawingInfo.renderer","subtypeField","type"])],le.prototype,"readRendererFromService",null),(0,i._)([(0,m.w)("renderer",["layerDefinition.drawingInfo.renderer"])],le.prototype,"readRenderer",null),(0,i._)([(0,c.M)({readOnly:!0,json:{read:!1}})],le.prototype,"spatialReference",null),(0,i._)([(0,c.M)({type:Number,json:{origins:{service:{read:!1}},write:{ignoreOrigin:!0}}})],le.prototype,"subtypeCode",void 0),(0,i._)([(0,c.M)({readOnly:!0,json:{read:!1}})],le.prototype,"subtypeField",null),(0,i._)([(0,c.M)({type:[X.A],json:{name:"layerDefinition.templates",write:{ignoreOrigin:!0}}})],le.prototype,"templates",void 0),(0,i._)([(0,m.w)("service","templates",["geometryType","subtypeField","subtypes","type"])],le.prototype,"readTemplatesFromService",null),(0,i._)([(0,c.M)({type:String,json:{write:{ignoreOrigin:!0}}})],le.prototype,"title",void 0),(0,i._)([(0,m.w)("service","title",["subtypes"])],le.prototype,"readTitleFromService",null),(0,i._)([(0,c.M)({readOnly:!0,json:{read:!1}})],le.prototype,"url",null),(0,i._)([(0,c.M)({readOnly:!0})],le.prototype,"userHasUpdateItemPrivileges",null),(0,i._)([(0,c.M)({type:Boolean,nonNullable:!0,json:{name:"visibility",write:{ignoreOrigin:!0}}})],le.prototype,"visible",void 0),le=(0,i._)([(0,f.$)("esri.layers.support.SubtypeSublayer")],le);const ae=(e,t,r)=>{if(!r)return t.createQuery();const i=Y.A.from(r);return i.where=ue(i.where,e.subtypeField,t.subtypeCode),i},ue=(e,t,r)=>{const i=new RegExp(`${t}\\s*=\\s*\\d+`),n=`${t}=${r}`,s=e??"";return i.test(s)?s.replace(i,n):(0,p.m)(n,s)},de=e=>new o.A(`This sublayer must have a parent SubtypeGroupLayer in order to use ${e}`),pe=le;var ye=r(96184),ce=r(91908),he=r(92935);const me="SubtypeGroupLayer";function fe(e,t){return new o.A("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}const ge=(0,N.p)();let be=class extends((0,T.j)((0,F.w6)((0,w.dM)((0,A.e)((0,x.j)((0,S.J)((0,v.b)((0,I.q)((0,M.A)((0,a.P)((0,_.d)((0,b.p)((0,n.O)(g.A)))))))))))))){constructor(...e){super(...e),this._sublayerLookup=new Map,this.fields=null,this.fieldsIndex=null,this.outFields=null,this.sublayers=new(s.A.ofType(pe)),this.supportedSourceTypes=new Set(["Feature Layer"]),this.timeInfo=null,this.title="Layer",this.type="subtype-group",this._debouncedSaveOperations=(0,u.sg)((async(e,t,i)=>{const{save:n,saveAs:s}=await r.e(5740).then(r.bind(r,33359));switch(e){case he.X.SAVE:return n(this,t);case he.X.SAVE_AS:return s(this,i,t)}})),this.addHandles((0,d.wB)((()=>this.sublayers),((e,t)=>this._handleSublayersChange(e,t)),d.OH))}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null,r=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(u.QP).then((async()=>{if(!this.url)throw new o.A("subtype-grouplayer:missing-url-or-source","SubtypeGroupLayer must be created with either a url or a portal item");if(null==this.layerId)throw new o.A("subtype-grouplayer:missing-layerid","layerId is required for a SubtypeGroupLayer created with url");return this._initLayerProperties(await this.createGraphicsSource(t))})).then((()=>(0,j.VA)(this,"load",e)));return this.addResolvingPromise(r),Promise.resolve(this)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return this.loaded&&null!=this.capabilities&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return(0,j.C$)(this)}get parsedUrl(){const e=(0,y.An)(this.url);return null!=e&&null!=this.layerId&&(e.path=(0,y.fj)(e.path,this.layerId.toString())),e}set source(e){this._get("source")!==e&&this._set("source",e)}readTitleFromService(e,{name:t}){return this.url?(0,O.yG)(this.url,t):t}async addAttachment(e,t){return(0,j.Xl)(this,e,t,me)}async updateAttachment(e,t,r){return(0,j.bt)(this,e,t,r,me)}async applyEdits(e,t){return(0,j.ct)(this,e,t)}on(e,t){return super.on(e,t)}async createGraphicsSource(e){const{default:t}=await(0,u.qr)(Promise.all([r.e(893),r.e(8132),r.e(2593),r.e(9062)]).then(r.bind(r,72593)),e);return new t({layer:this,supportedSourceTypes:this.supportedSourceTypes}).load({signal:e})}createQuery(){const e=(0,j.VZ)(this),t=this.sublayers.map((e=>e.subtypeCode));return e.where=(0,p.m)(`${this.subtypeField} IN (${t.join(",")})`,this.definitionExpression),e}async deleteAttachments(e,t){return(0,j.mm)(this,e,t,me)}async fetchRecomputedExtents(e){return(0,j.WP)(this,e,me)}findSublayerForFeature(e){const t=this.fieldsIndex.get(this.subtypeField),r=e.attributes[t.name];return this.findSublayerForSubtypeCode(r)}findSublayerForSubtypeCode(e){return this._sublayerLookup.get(e)}getFieldDomain(e,t){return this._getLayerDomain(e)}getField(e){return this.fieldsIndex.get(e)}loadAll(){return(0,l.g)(this,(e=>{e(this.sublayers)}))}async queryAttachments(e,t){return(0,j.lV)(this,e,t,me)}async queryFeatures(e,t){const r=await this.load(),i=Y.A.from(e)??r.createQuery(),n=i.outFields??[];n.includes(this.subtypeField)||(n.push(this.subtypeField),i.outFields=n);const s=await r.source.queryFeatures(i,t);if(s?.features)for(const e of s.features)e.layer=e.sourceLayer=this.findSublayerForFeature(e);return s}async queryObjectIds(e,t){return(0,j.sg)(this,e,t,me)}async queryFeatureCount(e,t){return(0,j.Ye)(this,e,t,me)}async queryExtent(e,t){return(0,j.B5)(this,e,t,me)}async queryRelatedFeatures(e,t){return(0,j.hM)(this,e,t,me)}async queryRelatedFeaturesCount(e,t){return(0,j.S2)(this,e,t,me)}async save(e){return this._debouncedSaveOperations(he.X.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(he.X.SAVE_AS,t,e)}write(e,t){const{origin:r,layerContainerType:i,messages:n}=t;if(this.isTable){if("web-scene"===r||"web-map"===r&&"tables"!==i)return n?.push(fe(this,"using a table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&"web-map"===r&&"tables"===i)return n?.push(fe(this,"using a non-table source cannot be written to tables in web maps")),null;return this.sublayers?.length?super.write(e,t):(n?.push(new o.A("web-document-write:invalid-property",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' has invalid value for 'sublayers' property. 'sublayers' collection should contain at least one sublayer`,{layer:this})),null)}serviceSupportsSpatialReference(e){return!!this.loaded&&(0,ce.D)(this,e)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}async _initLayerProperties(e){this._set("source",e);const{sourceJSON:t}=e;if(t&&(this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})),!this.subtypes?.length)throw new o.A("subtype-grouplayer:missing-subtypes","SubtypeGroupLayer must be created using a layer with subtypes");this._verifyFields(),(0,V.sv)(this.timeInfo,this.fieldsIndex)}async hasDataChanged(){return(0,j.jp)(this)}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("SubtypeGroupLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||-1!==e.search(/\/FeatureServer\//i)||this.fields?.some((e=>"geometry"===e.type))||console.log("SubtypeGroupLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_handleSublayersChange(e,t){t&&(t.forEach((e=>{e.parent=null})),this.removeHandles("sublayers-owner"),this._sublayerLookup.clear()),e&&(e.forEach((e=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)})),this.addHandles([e.on("after-add",(({item:e})=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)})),e.on("after-remove",(({item:e})=>{e.parent=null,this._sublayerLookup.delete(e.subtypeCode)}))],"sublayers-owner"))}};(0,i._)([(0,c.M)({readOnly:!0})],be.prototype,"createQueryVersion",null),(0,i._)([(0,c.M)({readOnly:!0})],be.prototype,"editingEnabled",null),(0,i._)([(0,c.M)({readOnly:!0})],be.prototype,"effectiveEditingEnabled",null),(0,i._)([(0,c.M)({...ge.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],be.prototype,"fields",void 0),(0,i._)([(0,c.M)(ge.fieldsIndex)],be.prototype,"fieldsIndex",void 0),(0,i._)([(0,c.M)(E.id)],be.prototype,"id",void 0),(0,i._)([(0,c.M)({type:["show","hide","hide-children"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],be.prototype,"listMode",void 0),(0,i._)([(0,c.M)({value:"SubtypeGroupLayer",type:["SubtypeGroupLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0}}}}})],be.prototype,"operationalLayerType",void 0),(0,i._)([(0,c.M)(ge.outFields)],be.prototype,"outFields",void 0),(0,i._)([(0,c.M)({readOnly:!0})],be.prototype,"parsedUrl",null),(0,i._)([(0,c.M)({clonable:!1})],be.prototype,"source",null),(0,i._)([(0,c.M)({type:s.A.ofType(pe),json:{origins:{service:{read:{source:"subtypes",reader:(e,t,r)=>{const i=e.map((({code:e})=>{const i=new pe({subtypeCode:e});return i.read(t,r),i}));return new(s.A.ofType(pe))(i)}}}},name:"layers",write:{ignoreOrigin:!0}}})],be.prototype,"sublayers",void 0),(0,i._)([(0,c.M)({type:ye.A})],be.prototype,"timeInfo",void 0),(0,i._)([(0,c.M)({json:{origins:{"portal-item":{write:{enabled:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}}}})],be.prototype,"title",void 0),(0,i._)([(0,m.w)("service","title",["name"])],be.prototype,"readTitleFromService",null),(0,i._)([(0,c.M)({json:{read:!1}})],be.prototype,"type",void 0),be=(0,i._)([(0,f.$)("esri.layers.SubtypeGroupLayer")],be);const ve=be},82935:(e,t,r)=>{r.d(t,{B:()=>c,e:()=>h});var i=r(90237),n=r(10107),s=(r(44208),r(53966),r(87811),r(36005)),o=r(40608),l=r(89317),a=r(30524),u=r(96184),d=r(73133),p=r(79677),y=r(10184);const c={type:Boolean,json:{read:{source:"timeAnimation"},write:{target:"timeAnimation",layerContainerTypes:l.K}}},h=e=>{let t=class extends e{constructor(){super(...arguments),this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0}readOffset(e,t){const r=t.timeInfo.exportOptions;if(!r)return null;const i=r.timeOffset,n=d.j.fromJSON(r.timeOffsetUnits);return i&&n?new y.A({value:i,unit:n}):null}set timeInfo(e){(0,a.sv)(e,this.fieldsIndex),this._set("timeInfo",e)}};return(0,i._)([(0,n.M)({type:p.A,json:{write:!1}})],t.prototype,"timeExtent",void 0),(0,i._)([(0,n.M)({type:y.A})],t.prototype,"timeOffset",void 0),(0,i._)([(0,s.w)("service","timeOffset",["timeInfo.exportOptions"])],t.prototype,"readOffset",null),(0,i._)([(0,n.M)({value:null,type:u.A,json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],t.prototype,"timeInfo",null),(0,i._)([(0,n.M)(c)],t.prototype,"useViewTime",void 0),t=(0,i._)([(0,o.$)("esri.layers.mixins.TemporalLayer")],t),t}},20437:(e,t,r)=>{r.d(t,{A:()=>f});var i,n=r(90237),s=r(66552),o=r(25482),l=r(10107),a=r(56507),u=(r(87811),r(44208),r(93223)),d=r(36005),p=r(40608),y=r(72088),c=r(98453);const h=new s.J({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",dateAndTime:"date-and-time",description:"description",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let m=i=class extends o.oY{constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:t}){let r=null;try{r=t?JSON.parse(t):null}catch(e){}return r?.value??null}readValueType(e,{description:t}){let r=null;try{r=t?JSON.parse(t):null}catch(e){}return r?h.fromJSON(r.fieldValueType):null}clone(){return new i({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain?.clone()??null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};(0,n._)([(0,l.M)({type:String,json:{write:!0}})],m.prototype,"alias",void 0),(0,n._)([(0,l.M)({type:[String,Number],json:{write:{allowNull:!0}}})],m.prototype,"defaultValue",void 0),(0,n._)([(0,l.M)()],m.prototype,"description",void 0),(0,n._)([(0,d.w)("description")],m.prototype,"readDescription",null),(0,n._)([(0,l.M)({types:y.gK,json:{read:{reader:y.rS},write:!0}})],m.prototype,"domain",void 0),(0,n._)([(0,l.M)({type:Boolean,json:{write:!0}})],m.prototype,"editable",void 0),(0,n._)([(0,l.M)({type:a.jz,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],m.prototype,"length",void 0),(0,n._)([(0,l.M)({type:String,json:{write:!0}})],m.prototype,"name",void 0),(0,n._)([(0,l.M)({type:Boolean,json:{write:!0}})],m.prototype,"nullable",void 0),(0,n._)([(0,u.e)(c.m)],m.prototype,"type",void 0),(0,n._)([(0,l.M)()],m.prototype,"valueType",void 0),(0,n._)([(0,d.w)("valueType",["description"])],m.prototype,"readValueType",null),(0,n._)([(0,l.M)({type:Boolean,json:{read:!1}})],m.prototype,"visible",void 0),m=i=(0,n._)([(0,p.$)("esri.layers.support.Field")],m);const f=m},95466:(e,t,r)=>{r.d(t,{A:()=>y});var i=r(49186),n=r(25482),s=r(53966),o=r(91869),l=r(3330),a=r(30524),u=r(56400),d=r(96285);const p=new Map;class y{static fromJSON(e){return new y(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new y(e.fields??[],f(e))}static fromLayerJSON(e){return new y(e.fields??[],f(e))}constructor(e=[],t){this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this._requiredFields=null,this.dateFields=[],this.numericFields=[],this.fields=e||[],this._timeZoneByFieldName=t?new Map(t):null;const r=[];for(const e of this.fields){const t=e?.name,i=h(t);if(t&&i){const n=c(t);this._fieldsMap.set(t,e),this._fieldsMap.set(n,e),this._normalizedFieldsMap.set(i,e),r.push(`${n}:${e.type}:${this._timeZoneByFieldName?.get(t)}`),(0,a.vE)(e)?(this.dateFields.push(e),this._dateFieldsSet.add(e)):(0,a.WA)(e)&&(this._numericFieldsSet.add(e),this.numericFields.push(e)),(0,a.te)(e)||(0,a.Xz)(e)||(e.editable=null==e.editable||!!e.editable,e.nullable=null==e.nullable||!!e.nullable)}}r.sort(),this.uid=r.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)(0,a.te)(e)||(0,a.Xz)(e)||e.nullable||void 0!==(0,a.lD)(e)||this._requiredFields.push(e)}return this._requiredFields}equals(e){return this.uid===e?.uid}has(e){return null!=this.get(e)}get(e){if(!e)return;let t=this._fieldsMap.get(e);return t||(t=this._fieldsMap.get(c(e))??this._normalizedFieldsMap.get(h(e)),t&&this._fieldsMap.set(e,t),t)}getTimeZone(e){const t=this.get(e&&"string"!=typeof e?e.name:e);return t?this._timeZoneByFieldName?this._timeZoneByFieldName.get(t.name):"date"===t.type||"esriFieldTypeDate"===t.type?(s.A.getLogger("esri.layers.support.FieldsIndex").error(new i.A("getTimeZone:no-timezone-information",`no time zone information for field '${t.name}'`)),u.n$):m.has(t.type)?u.L5:null:null}getLuxonTimeZone(e){const t=this.getTimeZone(e);return t?t===u.L5?l.GB.instance:t===u.n$?d.mQ.utcInstance:(0,o.tE)(p,t,(()=>d.oh.create(t))):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return(0,a.OH)(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){return this.get(e)?.name??void 0}toJSON(){return{fields:this.fields.map((e=>(0,n.Wj)(e)?e.toJSON():e)),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}}function c(e){return e.trim().toLowerCase()}function h(e){return(0,a.rS)(e)?.toLowerCase()??""}const m=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function f(e){const t=new Map;if(!e.fields)return t;const r=!0===e.datesInUnknownTimezone,{timeInfo:i,editFieldsInfo:n}=e,s=(i?"startField"in i?i.startField:i.startTimeField:"")??"",o=(i?"endField"in i?i.endField:i.endTimeField:"")??"",l=function(e){return"dateFieldsTimeZone"in e}(e)?e.dateFieldsTimeZone??null:e.dateFieldsTimeReference?(0,u.ZS)(e.dateFieldsTimeReference):null,a=n?function(e){return"timeZone"in e}(n)?n.timeZone??l:n.dateFieldsTimeReference?(0,u.ZS)(n.dateFieldsTimeReference):l??u.n$:null,d=i?function(e){return"timeZone"in e}(i)?i.timeZone??l:i.timeReference?(0,u.ZS)(i.timeReference):l:null,p=new Map([[c(n?.creationDateField??""),a],[c(n?.editDateField??""),a],[c(s),d],[c(o),d]]);for(const{name:i,type:n}of e.fields)if(m.has(n))t.set(i,u.L5);else if("date"!==n&&"esriFieldTypeDate"!==n)t.set(i,null);else if(r)t.set(i,u.L5);else{const e=p.get(c(i??""))??l;t.set(i,e)}return t}},96184:(e,t,r)=>{r.d(t,{A:()=>m});var i=r(90237),n=r(69540),s=r(25482),o=r(10107),l=(r(44208),r(53966),r(87811),r(36005)),a=r(40608),u=r(43937),d=r(79677),p=r(10184),y=r(56400);function c(e,t){return p.A.fromJSON({value:e,unit:t})}let h=class extends((0,n.O)(s.oY)){constructor(e){super(e),this.cumulative=!1,this.endField=null,this.fullTimeExtent=null,this.hasLiveData=!1,this.interval=null,this.startField=null,this.timeZone=null,this.trackIdField=null,this.useTime=!0,this.stops=null}readFullTimeExtent(e,t){return t.timeExtent&&Array.isArray(t.timeExtent)&&2===t.timeExtent.length?d.A.fromArray(t.timeExtent):null}writeFullTimeExtent(e,t){null!=e?.start&&null!=e.end?t.timeExtent=e.toArray():t.timeExtent=null}readInterval(e,t){return t.timeInterval&&t.timeIntervalUnits?c(t.timeInterval,t.timeIntervalUnits):t.defaultTimeInterval&&t.defaultTimeIntervalUnits?c(t.defaultTimeInterval,t.defaultTimeIntervalUnits):null}writeInterval(e,t){t.timeInterval=e?.toJSON().value??null,t.timeIntervalUnits=e?.toJSON().unit??null}};(0,i._)([(0,o.M)({type:Boolean,json:{name:"exportOptions.timeDataCumulative",write:!0}})],h.prototype,"cumulative",void 0),(0,i._)([(0,o.M)({type:String,json:{name:"endTimeField",write:{enabled:!0,allowNull:!0}}})],h.prototype,"endField",void 0),(0,i._)([(0,o.M)({type:d.A,json:{write:{enabled:!0,allowNull:!0}}})],h.prototype,"fullTimeExtent",void 0),(0,i._)([(0,l.w)("fullTimeExtent",["timeExtent"])],h.prototype,"readFullTimeExtent",null),(0,i._)([(0,u.K)("fullTimeExtent")],h.prototype,"writeFullTimeExtent",null),(0,i._)([(0,o.M)({type:Boolean,json:{write:!0}})],h.prototype,"hasLiveData",void 0),(0,i._)([(0,o.M)({type:p.A,json:{write:{enabled:!0,allowNull:!0}}})],h.prototype,"interval",void 0),(0,i._)([(0,l.w)("interval",["timeInterval","timeIntervalUnits","defaultTimeInterval","defaultTimeIntervalUnits"])],h.prototype,"readInterval",null),(0,i._)([(0,u.K)("interval")],h.prototype,"writeInterval",null),(0,i._)([(0,o.M)({type:String,json:{name:"startTimeField",write:{enabled:!0,allowNull:!0}}})],h.prototype,"startField",void 0),(0,i._)([(0,o.M)((0,y.P6)("timeReference",!0))],h.prototype,"timeZone",void 0),(0,i._)([(0,o.M)({type:String,json:{write:{enabled:!0,allowNull:!0}}})],h.prototype,"trackIdField",void 0),(0,i._)([(0,o.M)({type:Boolean,json:{name:"exportOptions.useTime",write:!0}})],h.prototype,"useTime",void 0),(0,i._)([(0,o.M)({type:[Date],json:{read:!1}})],h.prototype,"stops",void 0),h=(0,i._)([(0,a.$)("esri.layers.support.TimeInfo")],h);const m=h},72088:(e,t,r)=>{r.d(t,{rS:()=>I,gK:()=>T}),r(44208);var i,n=r(90237),s=r(4718),o=r(10107),l=(r(53966),r(93223)),a=r(40608),u=r(25482);r(87811);let d=i=class extends u.oY{constructor(e){super(e),this.name=null,this.code=null}clone(){return new i({name:this.name,code:this.code})}};(0,n._)([(0,o.M)({type:String,json:{write:!0}})],d.prototype,"name",void 0),(0,n._)([(0,o.M)({type:[String,Number],json:{write:!0}})],d.prototype,"code",void 0),d=i=(0,n._)([(0,a.$)("esri.layers.support.CodedValue")],d);const p=new(r(66552).J)({inherited:"inherited",codedValue:"coded-value",range:"range"});let y=class extends u.oY{constructor(e){super(e),this.name=null,this.type=null}};(0,n._)([(0,o.M)({type:String,json:{write:!0}})],y.prototype,"name",void 0),(0,n._)([(0,l.e)(p)],y.prototype,"type",void 0),y=(0,n._)([(0,a.$)("esri.layers.support.Domain")],y);const c=y;var h;let m=h=class extends c{constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let t=null;if(this.codedValues){const r=String(e);this.codedValues.some((e=>(String(e.code)===r&&(t=e.name),!!t)))}return t}clone(){return new h({codedValues:(0,s.o8)(this.codedValues),name:this.name})}};(0,n._)([(0,o.M)({type:[d],json:{write:!0}})],m.prototype,"codedValues",void 0),(0,n._)([(0,l.e)({codedValue:"coded-value"})],m.prototype,"type",void 0),m=h=(0,n._)([(0,a.$)("esri.layers.support.CodedValueDomain")],m);const f=m;var g;r(49186);let b=g=class extends c{constructor(e){super(e),this.type="inherited"}clone(){return new g}};(0,n._)([(0,l.e)({inherited:"inherited"})],b.prototype,"type",void 0),b=g=(0,n._)([(0,a.$)("esri.layers.support.InheritedDomain")],b);const v=b;var w;let _=w=class extends c{constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new w({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};(0,n._)([(0,o.M)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:null!=this.maxValue&&null==this.minValue}},target:"range",writer(e,t,r){t[r]=[this.minValue||0,e]}}}})],_.prototype,"maxValue",void 0),(0,n._)([(0,o.M)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[0]},write:{target:"range",writer(e,t,r){t[r]=[e,this.maxValue||0]}}}})],_.prototype,"minValue",void 0),(0,n._)([(0,l.e)({range:"range"})],_.prototype,"type",void 0),_=w=(0,n._)([(0,a.$)("esri.layers.support.RangeDomain")],_);const F=_,T={key:"type",base:c,typeMap:{range:_,"coded-value":f,inherited:v}};function I(e){if(!e?.type)return null;switch(e.type){case"range":return F.fromJSON(e);case"codedValue":return f.fromJSON(e);case"inherited":return v.fromJSON(e)}return null}},17036:(e,t,r)=>{r.d(t,{p:()=>a});var i=r(44208),n=r(53966),s=r(20437),o=r(95466),l=r(30524);function a(){return{fields:{type:[s.A],value:null,set:function(e){if(e&&(0,i.A)("big-integer-warning-enabled")){const t=e.filter((e=>"big-integer"===e.type||"oid"===e.type&&(e.length||0)>=8));if(t.length){const e=t.map((e=>`'${e.name}'`)).join(", ");n.A.getLogger(this).warn("#fields",`Layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}') references big-integer field(s): ${e}, support for which is experimental. Only integers less than ${Number.MAX_SAFE_INTEGER} (Number.MAX_SAFE_INTEGER) are supported.`)}}this._set("fields",e)}},fieldsIndex:{readOnly:!0,get(){return o.A.fromLayer(this)}},outFields:{type:[String],json:{read:!1},set:function(e){this._userOutFields=e,this.notifyChange("outFields")},get:function(){const e=this._userOutFields;if(!e?.length)return null;if(e.includes("*"))return["*"];if(!this.fields)return e;for(const t of e){const r=this.fieldsIndex?.has(t);r||n.A.getLogger("esri.layers.support.fieldProperties").error("field-attributes-layer:invalid-field",`Invalid field ${t} found in outFields`,{layer:this,outFields:e})}return(0,l.DB)(this.fieldsIndex,e)}}}}},98453:(e,t,r)=>{r.d(t,{m:()=>i});const i=new(r(66552).J)({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml",esriFieldTypeBigInteger:"big-integer",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"})},32730:(e,t,r)=>{r.d(t,{BI:()=>f,D3:()=>h,XJ:()=>m,lc:()=>c,mX:()=>b,rU:()=>g,tH:()=>T});var i=r(799);const n="__begin__",s="__end__",o=new RegExp(n,"ig"),l=new RegExp(s,"ig"),a=new RegExp("^"+n,"i"),u=new RegExp(s+"$","i"),d='"',p=d+" + ",y=" + "+d;function c(e){return e.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function h(e){return e.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function m(e){const t={expression:"",type:"none"};return e.labelExpressionInfo?e.labelExpressionInfo.value?(t.expression=e.labelExpressionInfo.value,t.type="conventional"):e.labelExpressionInfo.expression&&(t.expression=e.labelExpressionInfo.expression,t.type="arcade"):null!=e.labelExpression&&(t.expression=c(e.labelExpression),t.type="conventional"),t}function f(e){const t=m(e);if(!t)return null;switch(t.type){case"conventional":return b(t.expression);case"arcade":return t.expression}return null}function g(e){const t=m(e);if(!t)return null;switch(t.type){case"conventional":return function(e){const t=e?.match(v);return t?.[1].trim()||null}(t.expression);case"arcade":return T(t.expression)}return null}function b(e){let t;return e?(t=(0,i.HC)(e,(e=>n+'$feature["'+e+'"]'+s)),t=a.test(t)?t.replace(a,""):d+t,t=u.test(t)?t.replace(u,""):t+d,t=t.replaceAll(o,p).replaceAll(l,y)):t='""',t}const v=/^\s*\{([^}]+)\}\s*$/i,w=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*$/i,_=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,F=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(.+)(\1)\s*\));?\s*$/i;function T(e){if(!e)return null;let t=w.exec(e)||_.exec(e);return t?t[1]||t[3]:(t=F.exec(e),t?t[2]:null)}},73133:(e,t,r)=>{r.d(t,{j:()=>i});const i=(0,r(66552).O)()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:void 0})},10184:(e,t,r)=>{r.d(t,{A:()=>y});var i=r(90237),n=r(69540),s=r(25482),o=r(88930),l=r(10107),a=(r(44208),r(53966),r(87811),r(93223)),u=r(40608),d=r(73133);let p=class extends((0,n.O)(s.oY)){constructor(e){super(e),this.unit="milliseconds",this.value=0}toMilliseconds(){return(0,o.t)(this.value,this.unit,"milliseconds")}};(0,i._)([(0,a.e)(d.j,{nonNullable:!0})],p.prototype,"unit",void 0),(0,i._)([(0,l.M)({type:Number,json:{write:!0},nonNullable:!0})],p.prototype,"value",void 0),p=(0,i._)([(0,u.$)("esri.time.TimeInterval")],p);const y=p},92935:(e,t,r)=>{var i;r.d(t,{X:()=>i}),function(e){e[e.SAVE=0]="SAVE",e[e.SAVE_AS=1]="SAVE_AS"}(i||(i={}))}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9377,3069],{39516:(e,t,n)=>{async function i(e,t){const{WhereClause:i}=await Promise.all([n.e(835),n.e(4800)]).then(n.bind(n,50835));return i.create(e,{fieldsIndex:t})}function r(e,t){return"1=1"===e?t??e:"1=1"===t?e??t:null!=e&&""!==e?null!=t&&""!==t?`(${e}) AND (${t})`:e:t}n.d(t,{G:()=>i,m:()=>r})},3330:(e,t,n)=>{n.d(t,{GB:()=>r,Qo:()=>s,Y4:()=>o});var i=n(96285);class r{}function o(e){return e instanceof i.bo?e===r.instance:"unknown"===e?.toString().toLowerCase()}function s(e){return o(e)?r.instance:e}r.instance=new i.oh("Etc/UTC")},13069:(e,t,n)=>{n.d(t,{lk:()=>r,vD:()=>s,yS:()=>o});const i="randomUUID"in crypto;function r(){if(i)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function o(){return`{${r().toUpperCase()}}`}function s(){return`{${r()}}`}},70328:(e,t,n)=>{n.d(t,{BI:()=>x,Ej:()=>f,Hq:()=>u,Ie:()=>F,Jt:()=>w,Ne:()=>h,RF:()=>l,_F:()=>m,aI:()=>T,fA:()=>o,gX:()=>y,hZ:()=>_,iT:()=>a,is:()=>v,qv:()=>M,vI:()=>g,v_:()=>N,vt:()=>r,w1:()=>s});var i=n(5443);function r(e=N){return[e[0],e[1],e[2],e[3],e[4],e[5]]}function o(e,t,n,i,o,s,l=r()){return l[0]=e,l[1]=t,l[2]=n,l[3]=i,l[4]=o,l[5]=s,l}function s(e,t){const n=isFinite(e[2])||isFinite(e[5]);return new i.A(n?{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],zmin:e[2],zmax:e[5],spatialReference:t}:{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],spatialReference:t})}function l(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[3]),e[4]=Math.max(e[4],t[4]),e[5]=Math.max(e[5],t[5])}function a(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[0]),e[4]=Math.max(e[4],t[1]),e[5]=Math.max(e[5],t[2])}function u(e,t,n=0,i=t.length/3){let r=e[0],o=e[1],s=e[2],l=e[3],a=e[4],u=e[5];for(let e=0;e<i;e++)r=Math.min(r,t[n+3*e]),o=Math.min(o,t[n+3*e+1]),s=Math.min(s,t[n+3*e+2]),l=Math.max(l,t[n+3*e]),a=Math.max(a,t[n+3*e+1]),u=Math.max(u,t[n+3*e+2]);e[0]=r,e[1]=o,e[2]=s,e[3]=l,e[4]=a,e[5]=u}function p(e){return e[0]>=e[3]?0:e[3]-e[0]}function d(e){return e[1]>=e[4]?0:e[4]-e[1]}function c(e){return e[2]>=e[5]?0:e[5]-e[2]}function m(e){const t=p(e),n=c(e),i=d(e);return Math.sqrt(t*t+n*n+i*i)}function y(e,t=[0,0,0]){return t[0]=e[0]+p(e)/2,t[1]=e[1]+d(e)/2,t[2]=e[2]+c(e)/2,t}function f(e,t=[0,0,0]){return t[0]=p(e),t[1]=d(e),t[2]=c(e),t}function h(e,t,n=e){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n!==e&&(n[3]=e[3],n[4]=e[4],n[5]=e[5]),n}function g(e,t,n=e){return n[3]=t[0],n[4]=t[1],n[5]=t[2],n!==e&&(n[0]=e[0],n[1]=e[1],n[2]=e[2]),e}function _(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function F(e){return e?_(e,M):r(M)}function w(e,t){return e[0]=t[0],e[1]=t[1],e[2]=Number.NEGATIVE_INFINITY,e[3]=t[2],e[4]=t[3],e[5]=Number.POSITIVE_INFINITY,e}function x(e,t,n,i,r){return e[0]=t,e[1]=n,e[2]=Number.NEGATIVE_INFINITY,e[3]=i,e[4]=r,e[5]=Number.POSITIVE_INFINITY,e}function v(e){return 6===e.length}function T(e,t,n){if(null==e||null==t)return e===t;if(!v(e)||!v(t))return!1;if(n){for(let i=0;i<e.length;i++)if(!n(e[i],t[i]))return!1}else for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}n(19419);const M=[1/0,1/0,1/0,-1/0,-1/0,-1/0],N=[0,0,0,0,0,0];r()},33143:(e,t,n)=>{n.d(t,{A:()=>m});var i=n(90237),r=n(69540),o=n(25482),s=n(10107),l=(n(44208),n(53966),n(87811),n(36005)),a=n(40608),u=n(43937),p=n(72088),d=n(29005);let c=class extends((0,r.O)(o.oY)){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const n of Object.keys(e))t[n]=(0,p.rS)(e[n]);return t}writeDomains(e,t){const n={};for(const t of Object.keys(e))e[t]&&(n[t]=e[t]?.toJSON());t.domains=n}};(0,i._)([(0,s.M)({json:{write:!0}})],c.prototype,"id",void 0),(0,i._)([(0,s.M)({json:{write:!0}})],c.prototype,"name",void 0),(0,i._)([(0,s.M)({json:{write:!0}})],c.prototype,"domains",void 0),(0,i._)([(0,l.w)("domains")],c.prototype,"readDomains",null),(0,i._)([(0,u.K)("domains")],c.prototype,"writeDomains",null),(0,i._)([(0,s.M)({type:[d.A],json:{write:!0}})],c.prototype,"templates",void 0),c=(0,i._)([(0,a.$)("esri.layers.support.FeatureType")],c);const m=c},20437:(e,t,n)=>{n.d(t,{A:()=>h});var i,r=n(90237),o=n(66552),s=n(25482),l=n(10107),a=n(56507),u=(n(87811),n(44208),n(93223)),p=n(36005),d=n(40608),c=n(72088),m=n(98453);const y=new o.J({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",dateAndTime:"date-and-time",description:"description",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let f=i=class extends s.oY{constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:t}){let n=null;try{n=t?JSON.parse(t):null}catch(e){}return n?.value??null}readValueType(e,{description:t}){let n=null;try{n=t?JSON.parse(t):null}catch(e){}return n?y.fromJSON(n.fieldValueType):null}clone(){return new i({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain?.clone()??null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};(0,r._)([(0,l.M)({type:String,json:{write:!0}})],f.prototype,"alias",void 0),(0,r._)([(0,l.M)({type:[String,Number],json:{write:{allowNull:!0}}})],f.prototype,"defaultValue",void 0),(0,r._)([(0,l.M)()],f.prototype,"description",void 0),(0,r._)([(0,p.w)("description")],f.prototype,"readDescription",null),(0,r._)([(0,l.M)({types:c.gK,json:{read:{reader:c.rS},write:!0}})],f.prototype,"domain",void 0),(0,r._)([(0,l.M)({type:Boolean,json:{write:!0}})],f.prototype,"editable",void 0),(0,r._)([(0,l.M)({type:a.jz,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],f.prototype,"length",void 0),(0,r._)([(0,l.M)({type:String,json:{write:!0}})],f.prototype,"name",void 0),(0,r._)([(0,l.M)({type:Boolean,json:{write:!0}})],f.prototype,"nullable",void 0),(0,r._)([(0,u.e)(m.m)],f.prototype,"type",void 0),(0,r._)([(0,l.M)()],f.prototype,"valueType",void 0),(0,r._)([(0,p.w)("valueType",["description"])],f.prototype,"readValueType",null),(0,r._)([(0,l.M)({type:Boolean,json:{read:!1}})],f.prototype,"visible",void 0),f=i=(0,r._)([(0,d.$)("esri.layers.support.Field")],f);const h=f},95466:(e,t,n)=>{n.d(t,{A:()=>c});var i=n(49186),r=n(25482),o=n(53966),s=n(91869),l=n(3330),a=n(30524),u=n(56400),p=n(96285);const d=new Map;class c{static fromJSON(e){return new c(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new c(e.fields??[],h(e))}static fromLayerJSON(e){return new c(e.fields??[],h(e))}constructor(e=[],t){this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this._requiredFields=null,this.dateFields=[],this.numericFields=[],this.fields=e||[],this._timeZoneByFieldName=t?new Map(t):null;const n=[];for(const e of this.fields){const t=e?.name,i=y(t);if(t&&i){const r=m(t);this._fieldsMap.set(t,e),this._fieldsMap.set(r,e),this._normalizedFieldsMap.set(i,e),n.push(`${r}:${e.type}:${this._timeZoneByFieldName?.get(t)}`),(0,a.vE)(e)?(this.dateFields.push(e),this._dateFieldsSet.add(e)):(0,a.WA)(e)&&(this._numericFieldsSet.add(e),this.numericFields.push(e)),(0,a.te)(e)||(0,a.Xz)(e)||(e.editable=null==e.editable||!!e.editable,e.nullable=null==e.nullable||!!e.nullable)}}n.sort(),this.uid=n.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)(0,a.te)(e)||(0,a.Xz)(e)||e.nullable||void 0!==(0,a.lD)(e)||this._requiredFields.push(e)}return this._requiredFields}equals(e){return this.uid===e?.uid}has(e){return null!=this.get(e)}get(e){if(!e)return;let t=this._fieldsMap.get(e);return t||(t=this._fieldsMap.get(m(e))??this._normalizedFieldsMap.get(y(e)),t&&this._fieldsMap.set(e,t),t)}getTimeZone(e){const t=this.get(e&&"string"!=typeof e?e.name:e);return t?this._timeZoneByFieldName?this._timeZoneByFieldName.get(t.name):"date"===t.type||"esriFieldTypeDate"===t.type?(o.A.getLogger("esri.layers.support.FieldsIndex").error(new i.A("getTimeZone:no-timezone-information",`no time zone information for field '${t.name}'`)),u.n$):f.has(t.type)?u.L5:null:null}getLuxonTimeZone(e){const t=this.getTimeZone(e);return t?t===u.L5?l.GB.instance:t===u.n$?p.mQ.utcInstance:(0,s.tE)(d,t,(()=>p.oh.create(t))):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return(0,a.OH)(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){return this.get(e)?.name??void 0}toJSON(){return{fields:this.fields.map((e=>(0,r.Wj)(e)?e.toJSON():e)),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}}function m(e){return e.trim().toLowerCase()}function y(e){return(0,a.rS)(e)?.toLowerCase()??""}const f=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function h(e){const t=new Map;if(!e.fields)return t;const n=!0===e.datesInUnknownTimezone,{timeInfo:i,editFieldsInfo:r}=e,o=(i?"startField"in i?i.startField:i.startTimeField:"")??"",s=(i?"endField"in i?i.endField:i.endTimeField:"")??"",l=function(e){return"dateFieldsTimeZone"in e}(e)?e.dateFieldsTimeZone??null:e.dateFieldsTimeReference?(0,u.ZS)(e.dateFieldsTimeReference):null,a=r?function(e){return"timeZone"in e}(r)?r.timeZone??l:r.dateFieldsTimeReference?(0,u.ZS)(r.dateFieldsTimeReference):l??u.n$:null,p=i?function(e){return"timeZone"in e}(i)?i.timeZone??l:i.timeReference?(0,u.ZS)(i.timeReference):l:null,d=new Map([[m(r?.creationDateField??""),a],[m(r?.editDateField??""),a],[m(o),p],[m(s),p]]);for(const{name:i,type:r}of e.fields)if(f.has(r))t.set(i,u.L5);else if("date"!==r&&"esriFieldTypeDate"!==r)t.set(i,null);else if(n)t.set(i,u.L5);else{const e=d.get(m(i??""))??l;t.set(i,e)}return t}},72088:(e,t,n)=>{n.d(t,{rS:()=>M,gK:()=>T}),n(44208);var i,r=n(90237),o=n(4718),s=n(10107),l=(n(53966),n(93223)),a=n(40608),u=n(25482);n(87811);let p=i=class extends u.oY{constructor(e){super(e),this.name=null,this.code=null}clone(){return new i({name:this.name,code:this.code})}};(0,r._)([(0,s.M)({type:String,json:{write:!0}})],p.prototype,"name",void 0),(0,r._)([(0,s.M)({type:[String,Number],json:{write:!0}})],p.prototype,"code",void 0),p=i=(0,r._)([(0,a.$)("esri.layers.support.CodedValue")],p);const d=new(n(66552).J)({inherited:"inherited",codedValue:"coded-value",range:"range"});let c=class extends u.oY{constructor(e){super(e),this.name=null,this.type=null}};(0,r._)([(0,s.M)({type:String,json:{write:!0}})],c.prototype,"name",void 0),(0,r._)([(0,l.e)(d)],c.prototype,"type",void 0),c=(0,r._)([(0,a.$)("esri.layers.support.Domain")],c);const m=c;var y;let f=y=class extends m{constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let t=null;if(this.codedValues){const n=String(e);this.codedValues.some((e=>(String(e.code)===n&&(t=e.name),!!t)))}return t}clone(){return new y({codedValues:(0,o.o8)(this.codedValues),name:this.name})}};(0,r._)([(0,s.M)({type:[p],json:{write:!0}})],f.prototype,"codedValues",void 0),(0,r._)([(0,l.e)({codedValue:"coded-value"})],f.prototype,"type",void 0),f=y=(0,r._)([(0,a.$)("esri.layers.support.CodedValueDomain")],f);const h=f;var g;n(49186);let _=g=class extends m{constructor(e){super(e),this.type="inherited"}clone(){return new g}};(0,r._)([(0,l.e)({inherited:"inherited"})],_.prototype,"type",void 0),_=g=(0,r._)([(0,a.$)("esri.layers.support.InheritedDomain")],_);const F=_;var w;let x=w=class extends m{constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new w({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};(0,r._)([(0,s.M)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:null!=this.maxValue&&null==this.minValue}},target:"range",writer(e,t,n){t[n]=[this.minValue||0,e]}}}})],x.prototype,"maxValue",void 0),(0,r._)([(0,s.M)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[0]},write:{target:"range",writer(e,t,n){t[n]=[e,this.maxValue||0]}}}})],x.prototype,"minValue",void 0),(0,r._)([(0,l.e)({range:"range"})],x.prototype,"type",void 0),x=w=(0,r._)([(0,a.$)("esri.layers.support.RangeDomain")],x);const v=x,T={key:"type",base:m,typeMap:{range:x,"coded-value":h,inherited:F}};function M(e){if(!e?.type)return null;switch(e.type){case"range":return v.fromJSON(e);case"codedValue":return h.fromJSON(e);case"inherited":return F.fromJSON(e)}return null}},98453:(e,t,n)=>{n.d(t,{m:()=>i});const i=new(n(66552).J)({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml",esriFieldTypeBigInteger:"big-integer",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"})},32730:(e,t,n)=>{n.d(t,{BI:()=>h,D3:()=>y,XJ:()=>f,lc:()=>m,mX:()=>_,rU:()=>g,tH:()=>T});var i=n(799);const r="__begin__",o="__end__",s=new RegExp(r,"ig"),l=new RegExp(o,"ig"),a=new RegExp("^"+r,"i"),u=new RegExp(o+"$","i"),p='"',d=p+" + ",c=" + "+p;function m(e){return e.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function y(e){return e.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function f(e){const t={expression:"",type:"none"};return e.labelExpressionInfo?e.labelExpressionInfo.value?(t.expression=e.labelExpressionInfo.value,t.type="conventional"):e.labelExpressionInfo.expression&&(t.expression=e.labelExpressionInfo.expression,t.type="arcade"):null!=e.labelExpression&&(t.expression=m(e.labelExpression),t.type="conventional"),t}function h(e){const t=f(e);if(!t)return null;switch(t.type){case"conventional":return _(t.expression);case"arcade":return t.expression}return null}function g(e){const t=f(e);if(!t)return null;switch(t.type){case"conventional":return function(e){const t=e?.match(F);return t?.[1].trim()||null}(t.expression);case"arcade":return T(t.expression)}return null}function _(e){let t;return e?(t=(0,i.HC)(e,(e=>r+'$feature["'+e+'"]'+o)),t=a.test(t)?t.replace(a,""):p+t,t=u.test(t)?t.replace(u,""):t+p,t=t.replaceAll(s,d).replaceAll(l,c)):t='""',t}const F=/^\s*\{([^}]+)\}\s*$/i,w=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*$/i,x=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,v=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(.+)(\1)\s*\));?\s*$/i;function T(e){if(!e)return null;let t=w.exec(e)||x.exec(e);return t?t[1]||t[3]:(t=v.exec(e),t?t[2]:null)}},58501:(e,t,n)=>{n.d(t,{q:()=>r});var i=n(62815);function r(e,t,n){if(!n?.features||!n.hasZ)return;const r=(0,i.N)(n.geometryType,t,e.outSpatialReference);if(null!=r)for(const e of n.features)r(e.geometry)}},22671:(e,t,n)=>{n.d(t,{A:()=>F});var i,r=n(90237),o=n(59456),s=n(52106),l=n(66552),a=n(25482),u=n(4718),p=n(10107),d=(n(44208),n(53966),n(36005)),c=n(40608),m=n(43937),y=n(16930),f=n(65864),h=n(20437);const g=new l.J({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let _=i=class extends a.oY{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){const n=y.A.fromJSON(t.spatialReference),i=[];for(let t=0;t<e.length;t++){const r=e[t],o=s.A.fromJSON(r),l=r.geometry?.spatialReference;null==o.geometry||l||(o.geometry.spatialReference=n);const a=r.aggregateGeometries,u=o.aggregateGeometries;if(a&&null!=u)for(const e in u){const t=u[e],i=a[e],r=i?.spatialReference;null==t||r||(t.spatialReference=n)}i.push(o)}return i}writeGeometryType(e,t,n,i){if(e)return void g.write(e,t,n,i);const{features:r}=this;if(r)for(const e of r)if(null!=e?.geometry)return void g.write(e.geometry.type,t,n,i)}readQueryGeometry(e,t){if(!e)return null;const n=!!e.spatialReference,i=(0,f.rS)(e);return i&&!n&&t.spatialReference&&(i.spatialReference=y.A.fromJSON(t.spatialReference)),i}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:n}=this;if(n)for(const e of n)if(e&&null!=e.geometry&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new i(this.cloneProperties())}cloneProperties(){return(0,u.o8)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let n=0;n<t.features.length;n++){const i=t.features[n];if(i.geometry){const t=e?.[n];i.geometry=t?.toJSON()||i.geometry}}return t}quantize(e){const{scale:[t,n],translate:[i,r]}=e,o=this.features,s=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-i)/t)),(e=>Math.round((r-e)/n)));for(let e=0,t=o.length;e<t;e++)s?.(o[e].geometry)||(o.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:n}=this;if(!n)return this;const{translate:[i,r],scale:[o,s]}=n;let l=null,a=null;if(this.hasZ&&null!=n?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=n;l=n=>n*t+e}if(this.hasM&&null!=n?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=n;a=n=>null==n?n:n*t+e}const u=this._getHydrationFunction(e,(e=>e*o+i),(e=>r-e*s),l,a);for(const{geometry:e}of t)null!=e&&u&&u(e);return this.transform=null,this}_quantizePoints(e,t,n){let i,r;const o=[];for(let s=0,l=e.length;s<l;s++){const l=e[s];if(s>0){const e=t(l[0]),s=n(l[1]);e===i&&s===r||(o.push([e-i,s-r]),i=e,r=s)}else i=t(l[0]),r=n(l[1]),o.push([i,r])}return o.length>0?o:null}_getQuantizationFunction(e,t,n){return"point"===e?e=>(e.x=t(e.x),e.y=n(e.y),e):"polyline"===e||"polygon"===e?e=>{const i=(0,f.Bi)(e)?e.rings:e.paths,r=[];for(let e=0,o=i.length;e<o;e++){const o=i[e],s=this._quantizePoints(o,t,n);s&&r.push(s)}return r.length>0?((0,f.Bi)(e)?e.rings=r:e.paths=r,e):null}:"multipoint"===e?e=>{const i=this._quantizePoints(e.points,t,n);return i&&i.length>0?(e.points=i,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,n,i,r){return"point"===e?e=>{e.x=t(e.x),e.y=n(e.y),i&&(e.z=i(e.z))}:"polyline"===e||"polygon"===e?e=>{const o=(0,f.Bi)(e)?e.rings:e.paths;let s,l;for(let e=0,i=o.length;e<i;e++){const i=o[e];for(let e=0,r=i.length;e<r;e++){const r=i[e];e>0?(s+=r[0],l+=r[1]):(s=r[0],l=r[1]),r[0]=t(s),r[1]=n(l)}}if(i&&r)for(let e=0,t=o.length;e<t;e++){const t=o[e];for(let e=0,n=t.length;e<n;e++){const n=t[e];n[2]=i(n[2]),n[3]=r(n[3])}}else if(i)for(let e=0,t=o.length;e<t;e++){const t=o[e];for(let e=0,n=t.length;e<n;e++){const n=t[e];n[2]=i(n[2])}}else if(r)for(let e=0,t=o.length;e<t;e++){const t=o[e];for(let e=0,n=t.length;e<n;e++){const n=t[e];n[2]=r(n[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=n(e.ymin),e.xmax=t(e.xmax),e.ymax=n(e.ymax),i&&null!=e.zmax&&null!=e.zmin&&(e.zmax=i(e.zmax),e.zmin=i(e.zmin)),r&&null!=e.mmax&&null!=e.mmin&&(e.mmax=r(e.mmax),e.mmin=r(e.mmin))}:"multipoint"===e?e=>{const o=e.points;let s,l;for(let e=0,i=o.length;e<i;e++){const i=o[e];e>0?(s+=i[0],l+=i[1]):(s=i[0],l=i[1]),i[0]=t(s),i[1]=n(l)}if(i&&r)for(let e=0,t=o.length;e<t;e++){const t=o[e];t[2]=i(t[2]),t[3]=r(t[3])}else if(i)for(let e=0,t=o.length;e<t;e++){const t=o[e];t[2]=i(t[2])}else if(r)for(let e=0,t=o.length;e<t;e++){const t=o[e];t[2]=r(t[2])}}:null}};(0,r._)([(0,p.M)({type:String,json:{write:!0}})],_.prototype,"displayFieldName",void 0),(0,r._)([(0,p.M)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],_.prototype,"exceededTransferLimit",void 0),(0,r._)([(0,p.M)({type:[s.A],json:{write:!0}})],_.prototype,"features",void 0),(0,r._)([(0,d.w)("features")],_.prototype,"readFeatures",null),(0,r._)([(0,p.M)({type:[h.A],json:{write:!0}})],_.prototype,"fields",void 0),(0,r._)([(0,p.M)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:g.read}}})],_.prototype,"geometryType",void 0),(0,r._)([(0,m.K)("geometryType")],_.prototype,"writeGeometryType",null),(0,r._)([(0,p.M)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],_.prototype,"hasM",void 0),(0,r._)([(0,p.M)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],_.prototype,"hasZ",void 0),(0,r._)([(0,p.M)({types:o.yR,json:{write:!0}})],_.prototype,"queryGeometry",void 0),(0,r._)([(0,d.w)("queryGeometry")],_.prototype,"readQueryGeometry",null),(0,r._)([(0,p.M)({type:y.A,json:{write:!0}})],_.prototype,"spatialReference",void 0),(0,r._)([(0,m.K)("spatialReference")],_.prototype,"writeSpatialReference",null),(0,r._)([(0,p.M)({json:{write:!0}})],_.prototype,"transform",void 0),_=i=(0,r._)([(0,c.$)("esri.rest.support.FeatureSet")],_),_.prototype.toJSON.isDefaultToJSON=!0;const F=_}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7679,9377,3069],{39516:(e,t,i)=>{async function n(e,t){const{WhereClause:n}=await Promise.all([i.e(835),i.e(4800)]).then(i.bind(i,50835));return n.create(e,{fieldsIndex:t})}function r(e,t){return"1=1"===e?t??e:"1=1"===t?e??t:null!=e&&""!==e?null!=t&&""!==t?`(${e}) AND (${t})`:e:t}i.d(t,{G:()=>n,m:()=>r})},3330:(e,t,i)=>{i.d(t,{GB:()=>r,Qo:()=>s,Y4:()=>o});var n=i(96285);class r{}function o(e){return e instanceof n.bo?e===r.instance:"unknown"===e?.toString().toLowerCase()}function s(e){return o(e)?r.instance:e}r.instance=new n.oh("Etc/UTC")},13069:(e,t,i)=>{i.d(t,{lk:()=>r,vD:()=>s,yS:()=>o});const n="randomUUID"in crypto;function r(){if(n)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function o(){return`{${r().toUpperCase()}}`}function s(){return`{${r()}}`}},70328:(e,t,i)=>{i.d(t,{BI:()=>M,Ej:()=>f,Hq:()=>p,Ie:()=>_,Jt:()=>w,Ne:()=>h,RF:()=>a,_F:()=>y,aI:()=>N,fA:()=>o,gX:()=>m,hZ:()=>v,iT:()=>l,is:()=>x,qv:()=>b,vI:()=>g,v_:()=>j,vt:()=>r,w1:()=>s});var n=i(5443);function r(e=j){return[e[0],e[1],e[2],e[3],e[4],e[5]]}function o(e,t,i,n,o,s,a=r()){return a[0]=e,a[1]=t,a[2]=i,a[3]=n,a[4]=o,a[5]=s,a}function s(e,t){const i=isFinite(e[2])||isFinite(e[5]);return new n.A(i?{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],zmin:e[2],zmax:e[5],spatialReference:t}:{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],spatialReference:t})}function a(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[3]),e[4]=Math.max(e[4],t[4]),e[5]=Math.max(e[5],t[5])}function l(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[0]),e[4]=Math.max(e[4],t[1]),e[5]=Math.max(e[5],t[2])}function p(e,t,i=0,n=t.length/3){let r=e[0],o=e[1],s=e[2],a=e[3],l=e[4],p=e[5];for(let e=0;e<n;e++)r=Math.min(r,t[i+3*e]),o=Math.min(o,t[i+3*e+1]),s=Math.min(s,t[i+3*e+2]),a=Math.max(a,t[i+3*e]),l=Math.max(l,t[i+3*e+1]),p=Math.max(p,t[i+3*e+2]);e[0]=r,e[1]=o,e[2]=s,e[3]=a,e[4]=l,e[5]=p}function u(e){return e[0]>=e[3]?0:e[3]-e[0]}function d(e){return e[1]>=e[4]?0:e[4]-e[1]}function c(e){return e[2]>=e[5]?0:e[5]-e[2]}function y(e){const t=u(e),i=c(e),n=d(e);return Math.sqrt(t*t+i*i+n*n)}function m(e,t=[0,0,0]){return t[0]=e[0]+u(e)/2,t[1]=e[1]+d(e)/2,t[2]=e[2]+c(e)/2,t}function f(e,t=[0,0,0]){return t[0]=u(e),t[1]=d(e),t[2]=c(e),t}function h(e,t,i=e){return i[0]=t[0],i[1]=t[1],i[2]=t[2],i!==e&&(i[3]=e[3],i[4]=e[4],i[5]=e[5]),i}function g(e,t,i=e){return i[3]=t[0],i[4]=t[1],i[5]=t[2],i!==e&&(i[0]=e[0],i[1]=e[1],i[2]=e[2]),e}function v(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function _(e){return e?v(e,b):r(b)}function w(e,t){return e[0]=t[0],e[1]=t[1],e[2]=Number.NEGATIVE_INFINITY,e[3]=t[2],e[4]=t[3],e[5]=Number.POSITIVE_INFINITY,e}function M(e,t,i,n,r){return e[0]=t,e[1]=i,e[2]=Number.NEGATIVE_INFINITY,e[3]=n,e[4]=r,e[5]=Number.POSITIVE_INFINITY,e}function x(e){return 6===e.length}function N(e,t,i){if(null==e||null==t)return e===t;if(!x(e)||!x(t))return!1;if(i){for(let n=0;n<e.length;n++)if(!i(e[n],t[n]))return!1}else for(let i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0}i(19419);const b=[1/0,1/0,1/0,-1/0,-1/0,-1/0],j=[0,0,0,0,0,0];r()},11987:(e,t,i)=>{i.r(t),i.d(t,{default:()=>L});var n=i(90237),r=i(51447),o=i(53966),s=i(79677);(0,r.uW)(o.A.getLogger("esri.TimeExtent"),"esri.TimeExtent",{replacement:"esri.time.TimeExtent",version:"4.31",warnOnce:!0});var a=i(49186),l=i(66552),p=i(4718),u=i(93637),d=i(10107),c=(i(44208),i(40608)),y=i(13600),m=i(82935),f=i(69540),h=i(25482),g=(i(87811),i(69622)),v=i(21325);let _=class extends g.A{set horizontalWKID(e){e?(0,v.fn)({wkid:+e})?this._set("horizontalWKID",+e):this._set("horizontalWKID",e):this._set("horizontalWKID",null)}set verticalWKID(e){e?this._set("verticalWKID",isFinite(e)&&(0,v.fn)({wkid:+e})?+e:null):this._set("verticalWKID",null)}get isAdvanced(){const{affineTransformations:e,focalLength:t,principalOffsetPoint:i,radialDistortionCoefficients:n,tangentialDistortionCoefficients:r}=this;return e?.length>1&&!Number.isNaN(t)&&i?.length>1&&n?.length>1&&r?.length>1}};(0,n._)([(0,d.M)({json:{write:!0}})],_.prototype,"affineTransformations",void 0),(0,n._)([(0,d.M)({json:{write:!0}})],_.prototype,"focalLength",void 0),(0,n._)([(0,d.M)({json:{write:!0}})],_.prototype,"principalOffsetPoint",void 0),(0,n._)([(0,d.M)({json:{write:!0}})],_.prototype,"radialDistortionCoefficients",void 0),(0,n._)([(0,d.M)({json:{write:!0}})],_.prototype,"tangentialDistortionCoefficients",void 0),(0,n._)([(0,d.M)({json:{write:!0}})],_.prototype,"horizontalWKID",null),(0,n._)([(0,d.M)({json:{write:!0}})],_.prototype,"verticalWKID",null),(0,n._)([(0,d.M)({json:{write:!0}})],_.prototype,"x",void 0),(0,n._)([(0,d.M)({json:{write:!0}})],_.prototype,"y",void 0),(0,n._)([(0,d.M)({json:{write:!0}})],_.prototype,"z",void 0),(0,n._)([(0,d.M)({json:{write:!0}})],_.prototype,"type",void 0),_=(0,n._)([(0,c.$)("esri.layers.orientedImagery.core.CameraOrientation")],_);const w=_;let M=class extends((0,f.O)((0,h.Te)(w))){constructor(){super(...arguments),this.type=1}toString(){const{type:e,horizontalWKID:t,verticalWKID:i,x:n,y:r,z:o,heading:s,pitch:a,roll:l,affineTransformations:p,focalLength:u,principalOffsetPoint:d,radialDistortionCoefficients:c,tangentialDistortionCoefficients:y}=this,m=[e,t,i,n,r,o,s,a,l];return this.isAdvanced&&(p?.forEach((e=>m.push(e))),m.push(u),d?.forEach((e=>m.push(e))),c?.forEach((e=>m.push(e))),y?.forEach((e=>m.push(e)))),m.map((e=>Number.isNaN(e)?"":e)).join("|")}};(0,n._)([(0,d.M)({json:{write:!0}})],M.prototype,"type",void 0),(0,n._)([(0,d.M)({type:[Number],json:{write:!0}})],M.prototype,"affineTransformations",void 0),(0,n._)([(0,d.M)({type:Number,json:{write:!0}})],M.prototype,"focalLength",void 0),(0,n._)([(0,d.M)({type:[Number],json:{write:!0}})],M.prototype,"principalOffsetPoint",void 0),(0,n._)([(0,d.M)({type:[Number],json:{write:!0}})],M.prototype,"radialDistortionCoefficients",void 0),(0,n._)([(0,d.M)({type:[Number],json:{write:!0}})],M.prototype,"tangentialDistortionCoefficients",void 0),(0,n._)([(0,d.M)({type:Number,json:{write:!0}})],M.prototype,"heading",void 0),(0,n._)([(0,d.M)({type:Number,json:{write:!0}})],M.prototype,"pitch",void 0),(0,n._)([(0,d.M)({type:Number,json:{write:!0}})],M.prototype,"roll",void 0),(0,n._)([(0,d.M)({type:Number,json:{write:!0}})],M.prototype,"x",void 0),(0,n._)([(0,d.M)({type:Number,json:{write:!0}})],M.prototype,"y",void 0),(0,n._)([(0,d.M)({type:Number,json:{write:!0}})],M.prototype,"z",void 0),M=(0,n._)([(0,c.$)("esri.layers.orientedImagery.core.CameraOrientationHPR")],M);const x=M;let N=class extends((0,f.O)((0,h.Te)(w))){constructor(){super(...arguments),this.type=2}toString(){const{type:e,horizontalWKID:t,verticalWKID:i,x:n,y:r,z:o,omega:s,phi:a,kappa:l,affineTransformations:p,focalLength:u,principalOffsetPoint:d,radialDistortionCoefficients:c,tangentialDistortionCoefficients:y}=this,m=[e,t,i,n,r,o,s,a,l];return this.isAdvanced&&(p?.forEach((e=>m.push(e))),m.push(u),d?.forEach((e=>m.push(e))),c?.forEach((e=>m.push(e))),y?.forEach((e=>m.push(e)))),m.map((e=>isNaN(e)?"":e)).join("|")}};(0,n._)([(0,d.M)({json:{write:!0}})],N.prototype,"type",void 0),(0,n._)([(0,d.M)({type:[Number],json:{write:!0}})],N.prototype,"affineTransformations",void 0),(0,n._)([(0,d.M)({type:Number,json:{write:!0}})],N.prototype,"focalLength",void 0),(0,n._)([(0,d.M)({type:[Number],json:{write:!0}})],N.prototype,"principalOffsetPoint",void 0),(0,n._)([(0,d.M)({type:[Number],json:{write:!0}})],N.prototype,"radialDistortionCoefficients",void 0),(0,n._)([(0,d.M)({type:[Number],json:{write:!0}})],N.prototype,"tangentialDistortionCoefficients",void 0),(0,n._)([(0,d.M)({type:Number,json:{write:!0}})],N.prototype,"omega",void 0),(0,n._)([(0,d.M)({type:Number,json:{write:!0}})],N.prototype,"phi",void 0),(0,n._)([(0,d.M)({type:Number,json:{write:!0}})],N.prototype,"kappa",void 0),(0,n._)([(0,d.M)({type:Number,json:{write:!0}})],N.prototype,"x",void 0),(0,n._)([(0,d.M)({type:Number,json:{write:!0}})],N.prototype,"y",void 0),(0,n._)([(0,d.M)({type:Number,json:{write:!0}})],N.prototype,"z",void 0),N=(0,n._)([(0,c.$)("esri.layers.orientedImagery.core.CameraOrientationOPK")],N);const b=N;let j=class extends((0,f.O)((0,h.Te)(w))){constructor(){super(...arguments),this.type=3}get isAdvanced(){const{affineTransformations:e,focalLength:t,principalOffsetPoint:i,radialDistortionCoefficients:n,tangentialDistortionCoefficients:r}=this;return e?.length>1||!Number.isNaN(t)||i?.length>1||n?.length>1||r?.length>1}toString(){const{type:e,horizontalWKID:t,verticalWKID:i,x:n,y:r,z:o,yaw:s,pitch:a,roll:l,affineTransformations:p,focalLength:u,principalOffsetPoint:d,radialDistortionCoefficients:c,tangentialDistortionCoefficients:y}=this,m=[e,t,i,n,r,o,s,a,l];return this.isAdvanced&&(p?.forEach((e=>m.push(e))),m.push(u),d?.forEach((e=>m.push(e))),d?.forEach((e=>m.push(e))),c?.forEach((e=>m.push(e))),y?.forEach((e=>m.push(e)))),m.map((e=>Number.isNaN(e)?"":e)).join("|")}};(0,n._)([(0,d.M)({json:{write:!0}})],j.prototype,"type",void 0),(0,n._)([(0,d.M)({type:[Number],json:{write:!0}})],j.prototype,"affineTransformations",void 0),(0,n._)([(0,d.M)({type:Number,json:{write:!0}})],j.prototype,"focalLength",void 0),(0,n._)([(0,d.M)({type:[Number],json:{write:!0}})],j.prototype,"principalOffsetPoint",void 0),(0,n._)([(0,d.M)({type:[Number],json:{write:!0}})],j.prototype,"radialDistortionCoefficients",void 0),(0,n._)([(0,d.M)({type:[Number],json:{write:!0}})],j.prototype,"tangentialDistortionCoefficients",void 0),(0,n._)([(0,d.M)({type:Number,json:{write:!0}})],j.prototype,"yaw",void 0),(0,n._)([(0,d.M)({type:Number,json:{write:!0}})],j.prototype,"pitch",void 0),(0,n._)([(0,d.M)({type:Number,json:{write:!0}})],j.prototype,"roll",void 0),(0,n._)([(0,d.M)({type:Number,json:{write:!0}})],j.prototype,"x",void 0),(0,n._)([(0,d.M)({type:Number,json:{write:!0}})],j.prototype,"y",void 0),(0,n._)([(0,d.M)({type:Number,json:{write:!0}})],j.prototype,"z",void 0),j=(0,n._)([(0,c.$)("esri.layers.orientedImagery.core.CameraOrientationYPR")],j);const T=j;i(24183);let S=class extends((0,f.O)(h.oY)){constructor(){super(...arguments),this.url=null}};(0,n._)([(0,d.M)({type:Number,json:{write:!0}})],S.prototype,"lod",void 0),(0,n._)([(0,d.M)({type:String,json:{write:!0}})],S.prototype,"rasterFunction",void 0),(0,n._)([(0,d.M)({type:String,json:{write:!0}})],S.prototype,"url",void 0),S=(0,n._)([(0,c.$)("esri.layers.orientedImagery.core.ElevationSourceDefinitions.ElevationSource")],S);let P=class extends((0,f.O)(h.oY)){constructor(){super(...arguments),this.constantElevation=null}};var F;(0,n._)([(0,d.M)({type:Number,json:{write:!0}})],P.prototype,"constantElevation",void 0),P=(0,n._)([(0,c.$)("esri.layers.orientedImagery.core.ElevationSourceDefinitions.ConstantElevation")],P),function(e){e[e.HPR=1]="HPR",e[e.OPK=2]="OPK",e[e.YPR=3]="YPR",e[e.LTP=4]="LTP"}(F||(F={}));var I=i(58769);const D=new l.J({Minutes:"minutes",Hours:"hours",Days:"days",Weeks:"weeks",Months:"months",Years:"years"}),O=new l.J({360:"360",Horizontal:"horizontal",Inspection:"inspection",Nadir:"nadir",Oblique:"oblique","":null}),E=new Map;E.set(`${F.OPK}`,{desc:"Using Omega Phi Kappa",constructor:b}),E.set(`${F.HPR}`,{desc:"Using Heading, Pitch and Roll",constructor:x}),E.set(`${F.YPR}`,{desc:"Using Yaw, Pitch and Roll",constructor:T});const R=new Map;R.set(`${F.HPR}`,(function(e){const[t,i,n,r,o,s,a,l,p,u,d,c,y,m,f,h,g,v,_,w,M,x]=e.slice(1),N=[p,u,d,c,y,m].map((e=>Number(e))),b=[h,g].map((e=>Number(e))),j=[v,_,w],T=[M,x];return{horizontalWKID:t,verticalWKID:i,x:n,y:r,z:o,heading:s,pitch:a,roll:l,affineTransformations:6===N.filter(I.E).length?N:null,focalLength:f,principalOffsetPoint:2!==b.filter(I.E).length?null:b,radialDistortionCoefficients:3!==j.filter(I.E).length?null:j,tangentialDistortionCoefficients:2!==T.filter(I.E).length?null:T}})),R.set(`${F.YPR}`,(function(e){const[t,i,n,r,o,s,a,l,p,u,d,c,y,m,f,h,g,v,_,w,M,x]=e.slice(1),N=[p,u,d,c,y,m].map((e=>Number(e))),b=[h,g].map((e=>Number(e))),j=[v,_,w],T=[M,x];return{horizontalWKID:t,verticalWKID:i,x:n,y:r,z:o,yaw:s,pitch:a,roll:l,affineTransformations:6===N.filter(I.E).length?N:null,focalLength:f,principalOffsetPoint:2!==b.filter(I.E).length?null:b,radialDistortionCoefficients:3!==j.filter(I.E).length?null:j,tangentialDistortionCoefficients:2!==T.filter(I.E).length?null:T}})),R.set(`${F.OPK}`,(function(e){const[t,i,n,r,o,s,a,l,p,u,d,c,y,m,f,h,g,v,_,w,M,x]=e.slice(1),N=[p,u,d,c,y,m].map((e=>Number(e))),b=[h,g].map((e=>Number(e))),j=[v,_,w].map((e=>Number(e))),T=[M,x].map((e=>Number(e)));return{horizontalWKID:t,verticalWKID:i,x:n,y:r,z:o,omega:s,phi:a,kappa:l,affineTransformations:6===N.filter(I.E).length?N:null,focalLength:f,principalOffsetPoint:2!==b.filter(I.E).length?null:b,radialDistortionCoefficients:3!==j.filter(I.E).length?[0,0,0]:j,tangentialDistortionCoefficients:2!==T.filter(I.E).length?[0,0]:T}})),R.set(`${F.LTP}`,(function(e){const[t,i,n,r,o,...s]=e.slice(1),a=R.get(o);return a?{latitude:t,longitude:i,ellipsoidRadius:n,squaredEccentricity:r,properties:a([o,"",...s])}:null}));const z=new Set(["demPathPrefix","demPathSuffix","depthImagePathPrefix","depthImagePathSuffix","elevationSource","horizontalMeasurementUnit","verticalMeasurementUnit","videoPathPrefix","videoPathSuffix","timeAnimation","visibilityTimeExtent"]),$=(e,t)=>!z.has(t)&&e;function V(e,t,i,n){const{name:r,write:o,read:s}=((e,t,i)=>{const n=`orientedImageryProperties.${e}`;return{name:n,write:t?{ignoreOrigin:!0,target:n,writer:t}:{ignoreOrigin:!0},read:i?{ignoreOrigin:!0,source:n,reader:i}:{ignoreOrigin:!0}}})(e,t,i),a={name:r,write:o,read:s,origins:{service:{name:`orientedImageryInfo.${r}`,write:t,read:i},"web-scene":{name:r,write:$(o,e),read:$(s,e)},"web-map":{name:r,write:o,read:s}}};return n&&a.origins?(a.type=n,a.origins["web-map"].type=n,a.origins["web-scene"].type=n,a):a}let A=class extends y.default{constructor(){super(...arguments),this.cameraHeading=null,this.cameraHeight=null,this.cameraPitch=null,this.cameraRoll=null,this.coveragePercent=null,this.demPathPrefix=null,this.demPathSuffix=null,this.depthImagePathPrefix=null,this.depthImagePathSuffix=null,this.elevationSource=null,this.farDistance=null,this.geometryType="point",this.horizontalFieldOfView=null,this.horizontalMeasurementUnit=null,this.imagePathPrefix=null,this.imagePathSuffix=null,this.imageRotation=null,this.maximumDistance=null,this.nearDistance=null,this.operationalLayerType="OrientedImageryLayer",this.orientationAccuracy=null,this.orientedImageryType=null,this.supportedSourceTypes=new Set(["Oriented Imagery Layer"]),this.type="oriented-imagery",this.timeIntervalUnit="days",this.useViewTime=!0,this.verticalFieldOfView=null,this.verticalMeasurementUnit=null,this.videoPathPrefix=null,this.videoPathSuffix=null,this.visibilityTimeExtent=null}get effectiveElevationSource(){const{elevationSource:e,demPathPrefix:t,demPathSuffix:i}=this;return function(e,t,i){return e?(e=>null!=e&&"number"==typeof e.constantElevation)(e)?new P(e):function(e,t,i){let{url:n}=e;return n?(n=function(e,t,i){return t&&(e=`${t}${e}`),i&&(e+=`${i}`),e}(n,t,i),new S({...e,url:n})):null}(e,t,i):e}(e,t,i)}findFirstValidLayerId(e){return e.layers?.find((e=>this.supportedSourceTypes.has(e.type)))?.id}_verifySource(){if(super._verifySource(),"point"!==this.geometryType)throw new a.A("oriented-imagery-layer:invalid-geometry-type","OrientedImageryLayer only supports point geometry type")}};var C;(0,n._)([(0,d.M)({type:Number,json:V("cameraHeading")})],A.prototype,"cameraHeading",void 0),(0,n._)([(0,d.M)({type:Number,json:V("cameraHeight")})],A.prototype,"cameraHeight",void 0),(0,n._)([(0,d.M)({type:Number,json:V("cameraPitch")})],A.prototype,"cameraPitch",void 0),(0,n._)([(0,d.M)({type:Number,json:V("cameraRoll")})],A.prototype,"cameraRoll",void 0),(0,n._)([(0,d.M)({type:Number,json:V("coveragePercent")})],A.prototype,"coveragePercent",void 0),(0,n._)([(0,d.M)({type:String,json:V("demPathPrefix")})],A.prototype,"demPathPrefix",void 0),(0,n._)([(0,d.M)({type:String,json:V("demPathSuffix")})],A.prototype,"demPathSuffix",void 0),(0,n._)([(0,d.M)({type:String,json:V("depthImagePathPrefix")})],A.prototype,"depthImagePathPrefix",void 0),(0,n._)([(0,d.M)({type:String,json:V("depthImagePathSuffix")})],A.prototype,"depthImagePathSuffix",void 0),(0,n._)([(0,d.M)({type:Object,json:V("elevationSource")})],A.prototype,"elevationSource",void 0),(0,n._)([(0,d.M)()],A.prototype,"effectiveElevationSource",null),(0,n._)([(0,d.M)({type:Number,json:V("farDistance")})],A.prototype,"farDistance",void 0),(0,n._)([(0,d.M)()],A.prototype,"geometryType",void 0),(0,n._)([(0,d.M)({type:Number,json:V("horizontalFieldOfView")})],A.prototype,"horizontalFieldOfView",void 0),(0,n._)([(0,d.M)({type:String,json:V("horizontalMeasurementUnit")})],A.prototype,"horizontalMeasurementUnit",void 0),(0,n._)([(0,d.M)({type:String,json:V("imagePathPrefix")})],A.prototype,"imagePathPrefix",void 0),(0,n._)([(0,d.M)({type:String,json:V("imagePathSuffix")})],A.prototype,"imagePathSuffix",void 0),(0,n._)([(0,d.M)({type:Number,json:V("imageRotation")})],A.prototype,"imageRotation",void 0),(0,n._)([(0,d.M)({type:Number,json:V("maximumDistance")})],A.prototype,"maximumDistance",void 0),(0,n._)([(0,d.M)({type:Number,json:V("nearDistance")})],A.prototype,"nearDistance",void 0),(0,n._)([(0,d.M)({type:["OrientedImageryLayer"]})],A.prototype,"operationalLayerType",void 0),(0,n._)([(0,d.M)({json:{...V("orientationAccuracy",((e,t,i)=>{(0,u.sM)(i,e.join(";"),t)}),(e=>{const t=e?.split(";")?.map(Number);return function(e){return Array.isArray(e)&&9===e?.length&&!e.some(isNaN)}(t)?t:[0,0,0,0,0,0,0,0,0]}),String)}})],A.prototype,"orientationAccuracy",void 0),(0,n._)([(0,d.M)({json:{...V("orientedImageryType",O.write,O.read,O.jsonValues.slice(1))}})],A.prototype,"orientedImageryType",void 0),(0,n._)([(0,d.M)({json:{read:!1},value:"oriented-imagery",readOnly:!0})],A.prototype,"type",void 0),(0,n._)([(0,d.M)({json:{...V("timeIntervalUnit",D.write,D.read,D.jsonValues),type:D.apiValues}})],A.prototype,"timeIntervalUnit",void 0),(0,n._)([(0,d.M)((C=(0,p.o8)(m.B),C.json?(C.json.origins=C.json.origins??{},C.json.origins["web-scene"]={write:!1,read:!1},C):C))],A.prototype,"useViewTime",void 0),(0,n._)([(0,d.M)({type:Number,json:V("verticalFieldOfView")})],A.prototype,"verticalFieldOfView",void 0),(0,n._)([(0,d.M)({json:{...V("verticalMeasurementUnit"),type:new l.J({Feet:"feet",Meter:"meter"}).apiValues}})],A.prototype,"verticalMeasurementUnit",void 0),(0,n._)([(0,d.M)({type:String,json:V("videoPathPrefix")})],A.prototype,"videoPathPrefix",void 0),(0,n._)([(0,d.M)({type:String,json:V("videoPathSuffix")})],A.prototype,"videoPathSuffix",void 0),(0,n._)([(0,d.M)({type:s.A,json:{origins:{"web-scene":{write:!1,read:!1}}}})],A.prototype,"visibilityTimeExtent",void 0),A=(0,n._)([(0,c.$)("esri.layers.OrientedImageryLayer")],A);const L=A},33143:(e,t,i)=>{i.d(t,{A:()=>y});var n=i(90237),r=i(69540),o=i(25482),s=i(10107),a=(i(44208),i(53966),i(87811),i(36005)),l=i(40608),p=i(43937),u=i(72088),d=i(29005);let c=class extends((0,r.O)(o.oY)){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const i of Object.keys(e))t[i]=(0,u.rS)(e[i]);return t}writeDomains(e,t){const i={};for(const t of Object.keys(e))e[t]&&(i[t]=e[t]?.toJSON());t.domains=i}};(0,n._)([(0,s.M)({json:{write:!0}})],c.prototype,"id",void 0),(0,n._)([(0,s.M)({json:{write:!0}})],c.prototype,"name",void 0),(0,n._)([(0,s.M)({json:{write:!0}})],c.prototype,"domains",void 0),(0,n._)([(0,a.w)("domains")],c.prototype,"readDomains",null),(0,n._)([(0,p.K)("domains")],c.prototype,"writeDomains",null),(0,n._)([(0,s.M)({type:[d.A],json:{write:!0}})],c.prototype,"templates",void 0),c=(0,n._)([(0,l.$)("esri.layers.support.FeatureType")],c);const y=c},20437:(e,t,i)=>{i.d(t,{A:()=>h});var n,r=i(90237),o=i(66552),s=i(25482),a=i(10107),l=i(56507),p=(i(87811),i(44208),i(93223)),u=i(36005),d=i(40608),c=i(72088),y=i(98453);const m=new o.J({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",dateAndTime:"date-and-time",description:"description",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let f=n=class extends s.oY{constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:t}){let i=null;try{i=t?JSON.parse(t):null}catch(e){}return i?.value??null}readValueType(e,{description:t}){let i=null;try{i=t?JSON.parse(t):null}catch(e){}return i?m.fromJSON(i.fieldValueType):null}clone(){return new n({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain?.clone()??null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};(0,r._)([(0,a.M)({type:String,json:{write:!0}})],f.prototype,"alias",void 0),(0,r._)([(0,a.M)({type:[String,Number],json:{write:{allowNull:!0}}})],f.prototype,"defaultValue",void 0),(0,r._)([(0,a.M)()],f.prototype,"description",void 0),(0,r._)([(0,u.w)("description")],f.prototype,"readDescription",null),(0,r._)([(0,a.M)({types:c.gK,json:{read:{reader:c.rS},write:!0}})],f.prototype,"domain",void 0),(0,r._)([(0,a.M)({type:Boolean,json:{write:!0}})],f.prototype,"editable",void 0),(0,r._)([(0,a.M)({type:l.jz,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],f.prototype,"length",void 0),(0,r._)([(0,a.M)({type:String,json:{write:!0}})],f.prototype,"name",void 0),(0,r._)([(0,a.M)({type:Boolean,json:{write:!0}})],f.prototype,"nullable",void 0),(0,r._)([(0,p.e)(y.m)],f.prototype,"type",void 0),(0,r._)([(0,a.M)()],f.prototype,"valueType",void 0),(0,r._)([(0,u.w)("valueType",["description"])],f.prototype,"readValueType",null),(0,r._)([(0,a.M)({type:Boolean,json:{read:!1}})],f.prototype,"visible",void 0),f=n=(0,r._)([(0,d.$)("esri.layers.support.Field")],f);const h=f},95466:(e,t,i)=>{i.d(t,{A:()=>c});var n=i(49186),r=i(25482),o=i(53966),s=i(91869),a=i(3330),l=i(30524),p=i(56400),u=i(96285);const d=new Map;class c{static fromJSON(e){return new c(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new c(e.fields??[],h(e))}static fromLayerJSON(e){return new c(e.fields??[],h(e))}constructor(e=[],t){this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this._requiredFields=null,this.dateFields=[],this.numericFields=[],this.fields=e||[],this._timeZoneByFieldName=t?new Map(t):null;const i=[];for(const e of this.fields){const t=e?.name,n=m(t);if(t&&n){const r=y(t);this._fieldsMap.set(t,e),this._fieldsMap.set(r,e),this._normalizedFieldsMap.set(n,e),i.push(`${r}:${e.type}:${this._timeZoneByFieldName?.get(t)}`),(0,l.vE)(e)?(this.dateFields.push(e),this._dateFieldsSet.add(e)):(0,l.WA)(e)&&(this._numericFieldsSet.add(e),this.numericFields.push(e)),(0,l.te)(e)||(0,l.Xz)(e)||(e.editable=null==e.editable||!!e.editable,e.nullable=null==e.nullable||!!e.nullable)}}i.sort(),this.uid=i.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)(0,l.te)(e)||(0,l.Xz)(e)||e.nullable||void 0!==(0,l.lD)(e)||this._requiredFields.push(e)}return this._requiredFields}equals(e){return this.uid===e?.uid}has(e){return null!=this.get(e)}get(e){if(!e)return;let t=this._fieldsMap.get(e);return t||(t=this._fieldsMap.get(y(e))??this._normalizedFieldsMap.get(m(e)),t&&this._fieldsMap.set(e,t),t)}getTimeZone(e){const t=this.get(e&&"string"!=typeof e?e.name:e);return t?this._timeZoneByFieldName?this._timeZoneByFieldName.get(t.name):"date"===t.type||"esriFieldTypeDate"===t.type?(o.A.getLogger("esri.layers.support.FieldsIndex").error(new n.A("getTimeZone:no-timezone-information",`no time zone information for field '${t.name}'`)),p.n$):f.has(t.type)?p.L5:null:null}getLuxonTimeZone(e){const t=this.getTimeZone(e);return t?t===p.L5?a.GB.instance:t===p.n$?u.mQ.utcInstance:(0,s.tE)(d,t,(()=>u.oh.create(t))):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return(0,l.OH)(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){return this.get(e)?.name??void 0}toJSON(){return{fields:this.fields.map((e=>(0,r.Wj)(e)?e.toJSON():e)),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}}function y(e){return e.trim().toLowerCase()}function m(e){return(0,l.rS)(e)?.toLowerCase()??""}const f=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function h(e){const t=new Map;if(!e.fields)return t;const i=!0===e.datesInUnknownTimezone,{timeInfo:n,editFieldsInfo:r}=e,o=(n?"startField"in n?n.startField:n.startTimeField:"")??"",s=(n?"endField"in n?n.endField:n.endTimeField:"")??"",a=function(e){return"dateFieldsTimeZone"in e}(e)?e.dateFieldsTimeZone??null:e.dateFieldsTimeReference?(0,p.ZS)(e.dateFieldsTimeReference):null,l=r?function(e){return"timeZone"in e}(r)?r.timeZone??a:r.dateFieldsTimeReference?(0,p.ZS)(r.dateFieldsTimeReference):a??p.n$:null,u=n?function(e){return"timeZone"in e}(n)?n.timeZone??a:n.timeReference?(0,p.ZS)(n.timeReference):a:null,d=new Map([[y(r?.creationDateField??""),l],[y(r?.editDateField??""),l],[y(o),u],[y(s),u]]);for(const{name:n,type:r}of e.fields)if(f.has(r))t.set(n,p.L5);else if("date"!==r&&"esriFieldTypeDate"!==r)t.set(n,null);else if(i)t.set(n,p.L5);else{const e=d.get(y(n??""))??a;t.set(n,e)}return t}},72088:(e,t,i)=>{i.d(t,{rS:()=>b,gK:()=>N}),i(44208);var n,r=i(90237),o=i(4718),s=i(10107),a=(i(53966),i(93223)),l=i(40608),p=i(25482);i(87811);let u=n=class extends p.oY{constructor(e){super(e),this.name=null,this.code=null}clone(){return new n({name:this.name,code:this.code})}};(0,r._)([(0,s.M)({type:String,json:{write:!0}})],u.prototype,"name",void 0),(0,r._)([(0,s.M)({type:[String,Number],json:{write:!0}})],u.prototype,"code",void 0),u=n=(0,r._)([(0,l.$)("esri.layers.support.CodedValue")],u);const d=new(i(66552).J)({inherited:"inherited",codedValue:"coded-value",range:"range"});let c=class extends p.oY{constructor(e){super(e),this.name=null,this.type=null}};(0,r._)([(0,s.M)({type:String,json:{write:!0}})],c.prototype,"name",void 0),(0,r._)([(0,a.e)(d)],c.prototype,"type",void 0),c=(0,r._)([(0,l.$)("esri.layers.support.Domain")],c);const y=c;var m;let f=m=class extends y{constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let t=null;if(this.codedValues){const i=String(e);this.codedValues.some((e=>(String(e.code)===i&&(t=e.name),!!t)))}return t}clone(){return new m({codedValues:(0,o.o8)(this.codedValues),name:this.name})}};(0,r._)([(0,s.M)({type:[u],json:{write:!0}})],f.prototype,"codedValues",void 0),(0,r._)([(0,a.e)({codedValue:"coded-value"})],f.prototype,"type",void 0),f=m=(0,r._)([(0,l.$)("esri.layers.support.CodedValueDomain")],f);const h=f;var g;i(49186);let v=g=class extends y{constructor(e){super(e),this.type="inherited"}clone(){return new g}};(0,r._)([(0,a.e)({inherited:"inherited"})],v.prototype,"type",void 0),v=g=(0,r._)([(0,l.$)("esri.layers.support.InheritedDomain")],v);const _=v;var w;let M=w=class extends y{constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new w({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};(0,r._)([(0,s.M)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:null!=this.maxValue&&null==this.minValue}},target:"range",writer(e,t,i){t[i]=[this.minValue||0,e]}}}})],M.prototype,"maxValue",void 0),(0,r._)([(0,s.M)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[0]},write:{target:"range",writer(e,t,i){t[i]=[e,this.maxValue||0]}}}})],M.prototype,"minValue",void 0),(0,r._)([(0,a.e)({range:"range"})],M.prototype,"type",void 0),M=w=(0,r._)([(0,l.$)("esri.layers.support.RangeDomain")],M);const x=M,N={key:"type",base:y,typeMap:{range:M,"coded-value":h,inherited:_}};function b(e){if(!e?.type)return null;switch(e.type){case"range":return x.fromJSON(e);case"codedValue":return h.fromJSON(e);case"inherited":return _.fromJSON(e)}return null}},98453:(e,t,i)=>{i.d(t,{m:()=>n});const n=new(i(66552).J)({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml",esriFieldTypeBigInteger:"big-integer",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"})},32730:(e,t,i)=>{i.d(t,{BI:()=>h,D3:()=>m,XJ:()=>f,lc:()=>y,mX:()=>v,rU:()=>g,tH:()=>N});var n=i(799);const r="__begin__",o="__end__",s=new RegExp(r,"ig"),a=new RegExp(o,"ig"),l=new RegExp("^"+r,"i"),p=new RegExp(o+"$","i"),u='"',d=u+" + ",c=" + "+u;function y(e){return e.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function m(e){return e.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function f(e){const t={expression:"",type:"none"};return e.labelExpressionInfo?e.labelExpressionInfo.value?(t.expression=e.labelExpressionInfo.value,t.type="conventional"):e.labelExpressionInfo.expression&&(t.expression=e.labelExpressionInfo.expression,t.type="arcade"):null!=e.labelExpression&&(t.expression=y(e.labelExpression),t.type="conventional"),t}function h(e){const t=f(e);if(!t)return null;switch(t.type){case"conventional":return v(t.expression);case"arcade":return t.expression}return null}function g(e){const t=f(e);if(!t)return null;switch(t.type){case"conventional":return function(e){const t=e?.match(_);return t?.[1].trim()||null}(t.expression);case"arcade":return N(t.expression)}return null}function v(e){let t;return e?(t=(0,n.HC)(e,(e=>r+'$feature["'+e+'"]'+o)),t=l.test(t)?t.replace(l,""):u+t,t=p.test(t)?t.replace(p,""):t+u,t=t.replaceAll(s,d).replaceAll(a,c)):t='""',t}const _=/^\s*\{([^}]+)\}\s*$/i,w=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*$/i,M=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,x=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(.+)(\1)\s*\));?\s*$/i;function N(e){if(!e)return null;let t=w.exec(e)||M.exec(e);return t?t[1]||t[3]:(t=x.exec(e),t?t[2]:null)}},58501:(e,t,i)=>{i.d(t,{q:()=>r});var n=i(62815);function r(e,t,i){if(!i?.features||!i.hasZ)return;const r=(0,n.N)(i.geometryType,t,e.outSpatialReference);if(null!=r)for(const e of i.features)r(e.geometry)}},22671:(e,t,i)=>{i.d(t,{A:()=>_});var n,r=i(90237),o=i(59456),s=i(52106),a=i(66552),l=i(25482),p=i(4718),u=i(10107),d=(i(44208),i(53966),i(36005)),c=i(40608),y=i(43937),m=i(16930),f=i(65864),h=i(20437);const g=new a.J({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let v=n=class extends l.oY{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){const i=m.A.fromJSON(t.spatialReference),n=[];for(let t=0;t<e.length;t++){const r=e[t],o=s.A.fromJSON(r),a=r.geometry?.spatialReference;null==o.geometry||a||(o.geometry.spatialReference=i);const l=r.aggregateGeometries,p=o.aggregateGeometries;if(l&&null!=p)for(const e in p){const t=p[e],n=l[e],r=n?.spatialReference;null==t||r||(t.spatialReference=i)}n.push(o)}return n}writeGeometryType(e,t,i,n){if(e)return void g.write(e,t,i,n);const{features:r}=this;if(r)for(const e of r)if(null!=e?.geometry)return void g.write(e.geometry.type,t,i,n)}readQueryGeometry(e,t){if(!e)return null;const i=!!e.spatialReference,n=(0,f.rS)(e);return n&&!i&&t.spatialReference&&(n.spatialReference=m.A.fromJSON(t.spatialReference)),n}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:i}=this;if(i)for(const e of i)if(e&&null!=e.geometry&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new n(this.cloneProperties())}cloneProperties(){return(0,p.o8)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let i=0;i<t.features.length;i++){const n=t.features[i];if(n.geometry){const t=e?.[i];n.geometry=t?.toJSON()||n.geometry}}return t}quantize(e){const{scale:[t,i],translate:[n,r]}=e,o=this.features,s=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-n)/t)),(e=>Math.round((r-e)/i)));for(let e=0,t=o.length;e<t;e++)s?.(o[e].geometry)||(o.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:i}=this;if(!i)return this;const{translate:[n,r],scale:[o,s]}=i;let a=null,l=null;if(this.hasZ&&null!=i?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=i;a=i=>i*t+e}if(this.hasM&&null!=i?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=i;l=i=>null==i?i:i*t+e}const p=this._getHydrationFunction(e,(e=>e*o+n),(e=>r-e*s),a,l);for(const{geometry:e}of t)null!=e&&p&&p(e);return this.transform=null,this}_quantizePoints(e,t,i){let n,r;const o=[];for(let s=0,a=e.length;s<a;s++){const a=e[s];if(s>0){const e=t(a[0]),s=i(a[1]);e===n&&s===r||(o.push([e-n,s-r]),n=e,r=s)}else n=t(a[0]),r=i(a[1]),o.push([n,r])}return o.length>0?o:null}_getQuantizationFunction(e,t,i){return"point"===e?e=>(e.x=t(e.x),e.y=i(e.y),e):"polyline"===e||"polygon"===e?e=>{const n=(0,f.Bi)(e)?e.rings:e.paths,r=[];for(let e=0,o=n.length;e<o;e++){const o=n[e],s=this._quantizePoints(o,t,i);s&&r.push(s)}return r.length>0?((0,f.Bi)(e)?e.rings=r:e.paths=r,e):null}:"multipoint"===e?e=>{const n=this._quantizePoints(e.points,t,i);return n&&n.length>0?(e.points=n,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,i,n,r){return"point"===e?e=>{e.x=t(e.x),e.y=i(e.y),n&&(e.z=n(e.z))}:"polyline"===e||"polygon"===e?e=>{const o=(0,f.Bi)(e)?e.rings:e.paths;let s,a;for(let e=0,n=o.length;e<n;e++){const n=o[e];for(let e=0,r=n.length;e<r;e++){const r=n[e];e>0?(s+=r[0],a+=r[1]):(s=r[0],a=r[1]),r[0]=t(s),r[1]=i(a)}}if(n&&r)for(let e=0,t=o.length;e<t;e++){const t=o[e];for(let e=0,i=t.length;e<i;e++){const i=t[e];i[2]=n(i[2]),i[3]=r(i[3])}}else if(n)for(let e=0,t=o.length;e<t;e++){const t=o[e];for(let e=0,i=t.length;e<i;e++){const i=t[e];i[2]=n(i[2])}}else if(r)for(let e=0,t=o.length;e<t;e++){const t=o[e];for(let e=0,i=t.length;e<i;e++){const i=t[e];i[2]=r(i[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=i(e.ymin),e.xmax=t(e.xmax),e.ymax=i(e.ymax),n&&null!=e.zmax&&null!=e.zmin&&(e.zmax=n(e.zmax),e.zmin=n(e.zmin)),r&&null!=e.mmax&&null!=e.mmin&&(e.mmax=r(e.mmax),e.mmin=r(e.mmin))}:"multipoint"===e?e=>{const o=e.points;let s,a;for(let e=0,n=o.length;e<n;e++){const n=o[e];e>0?(s+=n[0],a+=n[1]):(s=n[0],a=n[1]),n[0]=t(s),n[1]=i(a)}if(n&&r)for(let e=0,t=o.length;e<t;e++){const t=o[e];t[2]=n(t[2]),t[3]=r(t[3])}else if(n)for(let e=0,t=o.length;e<t;e++){const t=o[e];t[2]=n(t[2])}else if(r)for(let e=0,t=o.length;e<t;e++){const t=o[e];t[2]=r(t[2])}}:null}};(0,r._)([(0,u.M)({type:String,json:{write:!0}})],v.prototype,"displayFieldName",void 0),(0,r._)([(0,u.M)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"exceededTransferLimit",void 0),(0,r._)([(0,u.M)({type:[s.A],json:{write:!0}})],v.prototype,"features",void 0),(0,r._)([(0,d.w)("features")],v.prototype,"readFeatures",null),(0,r._)([(0,u.M)({type:[h.A],json:{write:!0}})],v.prototype,"fields",void 0),(0,r._)([(0,u.M)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:g.read}}})],v.prototype,"geometryType",void 0),(0,r._)([(0,y.K)("geometryType")],v.prototype,"writeGeometryType",null),(0,r._)([(0,u.M)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"hasM",void 0),(0,r._)([(0,u.M)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"hasZ",void 0),(0,r._)([(0,u.M)({types:o.yR,json:{write:!0}})],v.prototype,"queryGeometry",void 0),(0,r._)([(0,d.w)("queryGeometry")],v.prototype,"readQueryGeometry",null),(0,r._)([(0,u.M)({type:m.A,json:{write:!0}})],v.prototype,"spatialReference",void 0),(0,r._)([(0,y.K)("spatialReference")],v.prototype,"writeSpatialReference",null),(0,r._)([(0,u.M)({json:{write:!0}})],v.prototype,"transform",void 0),v=n=(0,r._)([(0,c.$)("esri.rest.support.FeatureSet")],v),v.prototype.toJSON.isDefaultToJSON=!0;const _=v}}]);