@arcgis/core 6.0.0-next.7 → 6.0.0-next.8

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 (146) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/06ab24a083c3229228dd.js +1 -0
  3. package/assets/esri/core/workers/chunks/09a63cc1987f8636c5b0.js +1 -0
  4. package/assets/esri/core/workers/chunks/{7165d6f6a5078768bebb.js → 15cc2c295682f48030f9.js} +1 -1
  5. package/assets/esri/core/workers/chunks/17b76e0d401c7e396d10.js +1 -0
  6. package/assets/esri/core/workers/chunks/{c18189710d6198516175.js → 19b9d393046a780e6c3f.js} +1 -1
  7. package/assets/esri/core/workers/chunks/1b35ec54968fbeec17ce.js +1 -0
  8. package/assets/esri/core/workers/chunks/1c0c5cb13c2590aae906.js +1 -0
  9. package/assets/esri/core/workers/chunks/1e0d2715d603f48a7e0b.js +1 -0
  10. package/assets/esri/core/workers/chunks/{9a7fc93cc693fd12b5d8.js → 2b6c74646ff475a6e302.js} +1 -1
  11. package/assets/esri/core/workers/chunks/2d9a1f23ec6ce90723ac.js +1 -0
  12. package/assets/esri/core/workers/chunks/340621182db9e8edbec2.js +1 -0
  13. package/assets/esri/core/workers/chunks/{71f739bb3f7350704af6.js → 384ae10053d35940de73.js} +1 -1
  14. package/assets/esri/core/workers/chunks/3b3e519f15ed52c83f0c.js +1 -0
  15. package/assets/esri/core/workers/chunks/{72019baeba520edb6bb0.js → 3b737dae6efed627406e.js} +1 -1
  16. package/assets/esri/core/workers/chunks/3c0ed15b544df6fb0903.js +1 -0
  17. package/assets/esri/core/workers/chunks/451d7d456df0f4466563.js +1 -0
  18. package/assets/esri/core/workers/chunks/4a6b92ecbb1f1c55cc43.js +1 -0
  19. package/assets/esri/core/workers/chunks/4e544de61f07ca660236.js +1 -0
  20. package/assets/esri/core/workers/chunks/{06e7400f5ebe0719b81c.js → 5a5d80c2519aa3ea8878.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{fb4ff0ac2bc445fec413.js → 5b434e8c98e7119d4a3b.js} +1 -1
  22. package/assets/esri/core/workers/chunks/606ea251075fe81a1206.js +1 -0
  23. package/assets/esri/core/workers/chunks/{ac4cc49104d26c384e98.js → 658b2642ab6880770e4e.js} +1 -1
  24. package/assets/esri/core/workers/chunks/68be3fb88ca61f82fb90.js +1 -0
  25. package/assets/esri/core/workers/chunks/6c9266120d46e8c69dbf.js +1 -0
  26. package/assets/esri/core/workers/chunks/6ef647b7769d27529f9c.js +1 -0
  27. package/assets/esri/core/workers/chunks/709e019885822b1f6f3e.js +1 -0
  28. package/assets/esri/core/workers/chunks/8730e7e6e0296f43f10b.js +1 -0
  29. package/assets/esri/core/workers/chunks/8bea0d706ede6f84f8aa.js +1 -0
  30. package/assets/esri/core/workers/chunks/900181f68449d8f82eeb.js +1 -0
  31. package/assets/esri/core/workers/chunks/939942b00ba380e2957e.js +1 -0
  32. package/assets/esri/core/workers/chunks/{1ef39aef6b33c530cbe4.js → 966d0832a3c1f03668a0.js} +1 -1
  33. package/assets/esri/core/workers/chunks/9a28a66807a1e3557018.js +1 -0
  34. package/assets/esri/core/workers/chunks/{2f9033890c465acff698.js → 9bf48a907f91ea004648.js} +1 -1
  35. package/assets/esri/core/workers/chunks/9c7fa9d324fa0bf64d9c.js +1 -0
  36. package/assets/esri/core/workers/chunks/{1ba1f705b6ce5c8ea702.js → a655ebdb4bf0660615a2.js} +1 -1
  37. package/assets/esri/core/workers/chunks/af349c7bc8ef41a0e1bd.js +1 -0
  38. package/assets/esri/core/workers/chunks/c8ba0673d1b87216e619.js +1 -0
  39. package/assets/esri/core/workers/chunks/{4d3f97a48046021713a6.js → ceb112fe7aef354f8051.js} +1 -1
  40. package/assets/esri/core/workers/chunks/d6ad4390df576198e45b.js +1 -0
  41. package/assets/esri/core/workers/chunks/{801e9e66edb4961461eb.js → ded8b64a46992c3ae693.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{0b36abcbf03037b4073d.js → e1af43e2a8f2ef1059e3.js} +1 -1
  43. package/assets/esri/core/workers/chunks/eaf6d587477399a83088.js +1 -0
  44. package/assets/esri/core/workers/chunks/f122c18af10e56f9ec2b.js +1 -0
  45. package/assets/esri/core/workers/chunks/f31b424a3667686af10c.js +1 -0
  46. package/assets/esri/core/workers/chunks/{711cfb84659cb4437679.js → f528ac5c648ca6a98582.js} +1 -1
  47. package/assets/esri/core/workers/chunks/f92364afaefbac7e8f77.js +1 -0
  48. package/config.js +1 -1
  49. package/form/elements/inputs/DynamicChoiceInput.d.ts +35 -5
  50. package/geometry/support/scaleUtils.js +1 -1
  51. package/kernel.js +1 -1
  52. package/layers/ParquetLayer.d.ts +3 -2
  53. package/layers/ParquetLayer.js +1 -1
  54. package/layers/mixins/ScaleRangeLayer.js +1 -1
  55. package/layers/mixins/SublayersOwner.js +1 -1
  56. package/layers/support/Sublayer.js +1 -1
  57. package/layers/support/SubtypeSublayer.js +1 -1
  58. package/package.json +2 -2
  59. package/popup/FeaturesModel.d.ts +26 -5
  60. package/popup/FeaturesModel.js +1 -1
  61. package/rest/support/printTaskUtils.js +1 -1
  62. package/symbols/cim/CIMSymbolHelper.js +1 -1
  63. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/hittestUtils.js +1 -1
  64. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  65. package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js +1 -1
  66. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  67. package/views/2d/layers/LayerView2D.js +1 -1
  68. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  69. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  70. package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
  71. package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
  72. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  73. package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
  74. package/views/3d/analysis/Viewshed/types.d.ts +3 -1
  75. package/views/3d/environment/Environment.d.ts +2 -2
  76. package/views/3d/environment/Environment.js +1 -1
  77. package/views/3d/environment/EnvironmentView.js +2 -0
  78. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  79. package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
  80. package/views/3d/layers/DynamicLayerView3D.js +1 -1
  81. package/views/3d/layers/FeatureLikeLayerViewBase3D.js +1 -1
  82. package/views/3d/layers/FlowSubView3D.js +1 -1
  83. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  84. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  85. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  86. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  87. package/views/3d/layers/MediaLayerView3D.js +1 -1
  88. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  89. package/views/3d/layers/RouteLayerView3D.js +1 -1
  90. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  91. package/views/3d/layers/SceneLayerView3D.js +1 -1
  92. package/views/3d/layers/TiledLayerView3D.js +1 -1
  93. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  94. package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
  95. package/views/3d/layers/graphics/Labeler.js +1 -1
  96. package/views/3d/layers/support/FeatureTile.js +1 -1
  97. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  98. package/views/3d/layers/support/SampledGeometryMaxDistanceRatio.js +1 -1
  99. package/views/3d/support/popupHitTest.js +1 -1
  100. package/views/3d/webgl-engine/effects/WeatherFader.js +1 -1
  101. package/views/3d/webgl-engine/effects/clouds/CloudsComposition.js +1 -1
  102. package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
  103. package/views/3d/webgl-engine/lib/EmissionComposite.js +1 -1
  104. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  105. package/views/SceneView.js +1 -1
  106. package/views/interactive/snapping/FeatureSnappingSourceInfo.js +1 -1
  107. package/views/layers/LayerView.js +1 -1
  108. package/views/layers/LineOfSightLayerView.d.ts +3 -4
  109. package/views/layers/ViewshedLayerView.d.ts +5 -6
  110. package/views/support/layerViewUtils.js +1 -1
  111. package/widgets/Editor.d.ts +10 -0
  112. package/widgets/FeatureForm.d.ts +2 -2
  113. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  114. package/assets/esri/core/workers/chunks/00a600c71ceebe7bfeee.js +0 -1
  115. package/assets/esri/core/workers/chunks/00d24415bdeb0adae3df.js +0 -1
  116. package/assets/esri/core/workers/chunks/0193df3f9fb23633da87.js +0 -1
  117. package/assets/esri/core/workers/chunks/07aa6d36f1006b6ab7ff.js +0 -1
  118. package/assets/esri/core/workers/chunks/25d6c674b1c4829f040f.js +0 -1
  119. package/assets/esri/core/workers/chunks/25e6013e2c095629b236.js +0 -1
  120. package/assets/esri/core/workers/chunks/2c90f7a6432cd716db8b.js +0 -1
  121. package/assets/esri/core/workers/chunks/2e6a2f4d686b71249c0e.js +0 -1
  122. package/assets/esri/core/workers/chunks/303fde8f3459dde16555.js +0 -1
  123. package/assets/esri/core/workers/chunks/350540770781b281c39a.js +0 -1
  124. package/assets/esri/core/workers/chunks/3b017b718ea2d4ed498f.js +0 -1
  125. package/assets/esri/core/workers/chunks/43fc42405167a5537039.js +0 -1
  126. package/assets/esri/core/workers/chunks/4d82db661365daa513a6.js +0 -1
  127. package/assets/esri/core/workers/chunks/518e8883b6ed613bf451.js +0 -1
  128. package/assets/esri/core/workers/chunks/633a9051580c5302d2f7.js +0 -1
  129. package/assets/esri/core/workers/chunks/6469c0d18d3663e7da4b.js +0 -1
  130. package/assets/esri/core/workers/chunks/669e39c3437d7273f0c7.js +0 -1
  131. package/assets/esri/core/workers/chunks/7038ead1fa1674416ab3.js +0 -1
  132. package/assets/esri/core/workers/chunks/798a63653f82c0e842c5.js +0 -1
  133. package/assets/esri/core/workers/chunks/84fcbf7a1d04f01685d1.js +0 -1
  134. package/assets/esri/core/workers/chunks/8e511079918e2fd9261f.js +0 -1
  135. package/assets/esri/core/workers/chunks/95b82cbbe355266c65d7.js +0 -1
  136. package/assets/esri/core/workers/chunks/9673a9efec86040b8c13.js +0 -1
  137. package/assets/esri/core/workers/chunks/a010d2e4e34eb7bc1fec.js +0 -1
  138. package/assets/esri/core/workers/chunks/b05a41a60e30935644be.js +0 -1
  139. package/assets/esri/core/workers/chunks/d21257d2e2a37266c0f7.js +0 -1
  140. package/assets/esri/core/workers/chunks/d270cc9807161033686e.js +0 -1
  141. package/assets/esri/core/workers/chunks/ec9a2425b4a498054a19.js +0 -1
  142. package/assets/esri/core/workers/chunks/f0a68d2900d24f56afa0.js +0 -1
  143. package/assets/esri/core/workers/chunks/f762f70e7d39634ce797.js +0 -1
  144. package/assets/esri/core/workers/chunks/fd0254c6fc6c03ec11ba.js +0 -1
  145. package/assets/esri/core/workers/chunks/fd0a5c243f3426f2a0b5.js +0 -1
  146. package/views/3d/environment/EnvironmentManager.js +0 -2
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../Camera.js";import n from"../Viewpoint.js";import r from"../core/Collection.js";import{byId as i}from"../core/domUtils.js";import a from"../core/Error.js";import{on as o}from"../core/events.js";import{destroyHandle as s,makeHandle as c}from"../core/handleUtils.js";import has from"../core/has.js";import l from"../core/Logger.js";import{mapCollectionAsync as ee}from"../core/mapCollectionUtils.js";import{destroyMaybe as u,maybeProperty as te}from"../core/maybe.js";import{throwIfDestroyed as ne,throwIfAborted as d,createAbortError as re}from"../core/promiseUtils.js";import ie from"../core/ReactiveSet.js";import{on as f,watch as p,initial as m,sync as h,whenOnce as ae,syncAndInitial as g}from"../core/reactiveUtils.js";import{setFrameDuration as oe,cleanupScheduling as se}from"../core/scheduling.js";import{createScreenPoint as ce,createScreenPointArray as le}from"../core/screenUtils.js";import{cleanupWhereClauseCache as ue}from"../core/sql.js";import{getDefaultVerticalUnitStringForSR as de,getMetersPerUnitForSR as fe}from"../core/units.js";import{property as _,cast as v,subclass as pe}from"../core/accessorSupport/decorators.js";import{ensureType as y,ensureClass as b}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as me}from"../core/accessorSupport/overrideDefaultsFrom.js";import{runUntracked as he}from"../core/accessorSupport/tracking.js";import{drainNotificationQueue as ge}from"../core/accessorSupport/trackingUtils.js";import{create as _e}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as ve}from"../core/libs/rbush/PooledRBush.js";import{initialize as ye}from"../core/workers/workers.js";import x from"../geometry/Extent.js";import be from"../geometry/HeightModelInfo.js";import S from"../geometry/Point.js";import{project as C,canProjectWithoutEngine as xe}from"../geometry/projectionUtils.js";import w from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as Se}from"../geometry/spatialReferenceEllipsoidUtils.js";import{projectBoundingRect as Ce}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as T}from"../geometry/projection/projectPointToVector.js";import{toExtent as we,create as Te}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as Ee}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as De}from"../geometry/support/scaleUtils.js";import{wgs84 as Oe,webMercator as ke}from"../geometry/support/spatialReferenceUtils.js";import{makeDehydratedPoint as Ae}from"../layers/graphics/dehydratedPoint.js";import{isImageryTileLayer as E,isTiledLayer as D,isVoxelLayer as O,isIntegratedMeshLayer as k,isGaussianSplatLayer as je}from"../layers/support/layerUtils.js";import{TilemapCache as Me}from"../layers/support/TilemapCache.js";import{clearDefaultPortalInstance as Ne}from"../portal/portalDefault.js";import{WebSceneTag as Pe}from"../support/tagSymbols.js";import{BreakpointsOwner as Fe}from"./BreakpointsOwner.js";import{DOMContainer as Ie}from"./DOMContainer.js";import{PopupView as Le}from"./PopupView.js";import A from"./View.js";import Re from"./ViewAnimation.js";import{stringFromViewingMode as j,viewingModeFromString as M}from"./ViewingMode.js";import{GroundView3D as ze}from"./3d/GroundView3D.js";import{layerView3DImporter as N}from"./3d/layerViewModuleImportUtils.js";import{importAnalysisViewModule as Be}from"./3d/analysis/analysisViewModuleImportUtils.js";import{cleanupIntersectionUtils as Ve}from"./3d/camera/intersectionUtils.js";import P from"./3d/constraints/Constraints.js";import F from"./3d/environment/Environment.js";import{EnvironmentManager as He}from"./3d/environment/EnvironmentManager.js";import Ue from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as We}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as Ge}from"./3d/layers/graphics/Labeler.js";import Ke from"./3d/layers/i3s/I3SLodHandling.js";import{Navigation3D as qe}from"./3d/navigation/Navigation3D.js";import{ScreenSizePerspective as Je}from"./3d/state/ScreenSizePerspective.js";import I from"./3d/state/ViewState.js";import{ViewStateManager as Ye,cleanupViewStateManager as Xe}from"./3d/state/ViewStateManager.js";import{cleanupPointToPointAnimationController as Ze}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as Qe}from"./3d/state/helpers/SceneIntersectionHelper.js";import{cleanupNavigationUtils as $e}from"./3d/state/utils/navigationUtils.js";import et from"./3d/support/Attribution3D.js";import{CombinedElevationProvider as tt}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as L}from"./3d/support/debugFlags.js";import{getElevationAtPoint as nt}from"./3d/support/ElevationProvider.js";import{GroundAndIMSurface as rt}from"./3d/support/GroundAndIMSurface.js";import{toMap as it,hitTest as at}from"./3d/support/hitTest.js";import{popupHitTest as ot}from"./3d/support/popupHitTest.js";import{getDefaultQualityProfileName as st,getQualityProfileSettings as R}from"./3d/support/QualityProfile.js";import z from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as ct}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as lt}from"./3d/support/ResourceController.js";import ut from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as dt}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as ft}from"./3d/support/ViewSlice.js";import{PointsOfInterest as B}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import V from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as pt,getTiledLayerInfo as mt,checkIfTileInfoSupportedForView as ht}from"./3d/terrain/terrainUtils.js";import{clearTilePerLayerInfo as gt}from"./3d/terrain/TilePerLayerInfo.js";import{cleanupTileRenderer as _t}from"./3d/terrain/TileRenderer.js";import{Stage as vt}from"./3d/webgl-engine/Stage.js";import{olidEnabled as yt}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{cleanupRenderOccluded as bt}from"./3d/webgl-engine/effects/geometry/RenderOccluded.js";import{defaultTolerance as H}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as xt}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as U}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{cleanupEdgeProcessing as St}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import W from"./interactive/options/ViewOptions.js";import Ct from"./support/AnalysisViewManager.js";import{cleanupDrapedUtils as wt}from"./support/drapedUtils.js";import{occludeesSupported as Tt}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as G,createScreenPointFromSupportedEvent as K}from"./support/screenUtils.js";import{isSpatialReferenceSupported as Et}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as Dt,destroyTextureCompressionWorker as Ot}from"./support/TextureCompressionHelper.js";import kt from"./ui/DefaultUI.js";import At from"./ui/3d/DefaultUI3D.js";import jt from"../webscene/Environment.js";import{clearVNodeCache as Mt}from"../widgets/support/vnodeCache.js";var q;const Nt=Symbol(),J=Symbol();function Pt(e){let t=b(W,e);return t!==e&&e.snapping?.enabled==null&&(t.snapping.enabled=!0),t}let Y=class extends Fe(Le(Ie(A))){static{q=this}get timeZone(){return super.timeZone}set timeZone(e){super.timeZone=e}constructor(e){super(e),this.options=new W({snapping:{enabled:!0}}),this._userClippingArea=null,this._clippingArea=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=lt(this),this.deconflictor=new We({view:this}),this.attribution3D=new et({view:this}),this.labeler=new Ge({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.navigation=new qe({view:this}),this.basemapTerrain=null,this.elevationProvider=new tt({view:this}),this._canvas=null,this.constraints=new P,this._environment=new F,this.environmentManager=new He,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new Ct({importAnalysisViewModule:e=>Be(e),view:this}),this.groundView=null,this.groundAndIMSurface=null,this.map=null,this._featureTileTreeClients=new ie,this._featureTiles=null,this._featureTreeDebugger=null,this.state=new I({view:this}),this.slice=new ft,this.spatialReference=null,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type=`3d`,this.ui=new At,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,ye();let t=()=>this._updatingChanged();this.addHandles(s(ee(()=>this.map?.allLayers,async e=>{try{await e.when()}catch{}finally{t()}}))),this.addHandles([f(()=>this.map?.allLayers,`after-changes`,t,{onListenerAdd:t,onListenerRemove:t,sync:!0}),this.allLayerViews.on(`after-changes`,e=>this._updateUpdatingMonitors(e)),p(()=>this.scene,e=>e?.load().catch(()=>{}))]),this.inputManager=new Ue({view:this}),this.stateManager=new Ye({view:this}),this.screenSizePerspective=new Je({view:this})}initialize(){if(has(`enable-feature:esri-compress-textures`)&&has(`wasm-simd`)){let e=Dt(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new ze({view:this}),this.groundAndIMSurface=new rt({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},m),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},m),this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,e=>oe(e>0?1e3/Math.ceil(e):0),m),this.addHandles([p(()=>this.spatialReference,()=>this.notifyChange(`clippingArea`),h),p(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),h)])}destroy(){this.destroyed||(Ot(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),this.elevationProvider.destroy(),this.ui.removeAllHandles(),this.layerViewManager.clearHandles(),this.invalidate(),this.layerViewManager.clear(),this._set(`analysisViewManager`,u(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this.sharedSymbolResources=u(this.sharedSymbolResources),this._set(`labeler`,u(this.labeler)),this._set(`deconflictor`,u(this.deconflictor)),this._resourceController=u(this._resourceController),this._set(`stateManager`,u(this.stateManager)),this._set(`inputManager`,u(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this.removeHandles(`updatingMonitors`),this._set(`environmentManager`,u(this.environmentManager)),this._set(`environment`,u(this.environment)),this.groundView=u(this.groundView),this.groundAndIMSurface.destroy(),this.slice.destroy(),this._updatingObjectsWithProgress.length=0,this._updatingObjects.length=0,this.ui?.destroy(),this._set(`ui`,null),this._set(`renderCanvas`,null),this._set(`canvas`,null),this._canvas=null,this.screenSizePerspective.destroy(),this.attribution3D.destroy())}get stage(){return this._stage}get renderSpatialReference(){return this.renderCoordsHelper?.spatialReference}get groundSpatialReference(){return this.groundView?.spatialReference}get analyses(){return super.analyses}set analyses(e){super.analyses=e}get animation(){return this.state?.animation}get overlayManager(){return this.basemapTerrain?.overlayManager}get camera(){return this.stateManager?.camera}set camera(e){this.stateManager&&(this.stateManager.camera=e)}get contentCamera(){return this.stateManager?.contentCamera}set contentCamera(e){this.stateManager&&(this.stateManager.contentCamera=e)}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get canvas(){return this._canvas}get center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=y(S,e))}get clippingArea(){if(this.viewingMode===`global`)return null;let e=this.map,t=this._userClippingArea||te(e,`clippingArea`);return!(this._userClippingArea||te(e,`clippingEnabled`))||t==null?(this._clippingArea=null,null):t instanceof x?this.spatialReference&&(t=X(t,this.spatialReference),t==null)?(l.getLogger(this).error(`#clippingArea`,`setting clippingArea with incompatible SpatialReference`),this._clippingArea):(t=t.clone(),t.intersection(this._groundAndLayersExtent)??(t.xmin=t.xmax,t.ymin=t.ymax),t.zmin=void 0,t.zmax=void 0,t.equals(this._clippingArea)||(this._clippingArea=t),this._clippingArea):(l.getLogger(this).error(`#clippingArea`,`only clippingArea geometries of type Extent are supported`),this._clippingArea)}set clippingArea(e){this.ready&&this.viewingMode===`global`&&e!=null?l.getLogger(this).error(`#clippingArea=`,`Clipping area is only supported in local viewingMode`):this._userClippingArea=e}get renderDataExtent(){if(this.state.viewingMode===1)return null;let e=this.renderSpatialReference,t=this.dataExtent;return t==null||e==null||t.spatialReference.equals(e)?t:X(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent,t=this.spatialReference||w.WGS84,n=X(this.clippingArea,t);n!=null&&(e=e==null?n:e.intersection(n));let r=this._get(`dataExtent`);return e!=null&&e.equals(r)?r:e}get _groundAndLayersExtent(){let e=this.spatialReference||w.WGS84,t,n=n=>{let r=X(n,e);r!=null&&(t==null?t=r.clone():t.union(r))},{groundView:r}=this,i=r?.spatialReference,a=r?.fullGroundExtent;i&&a&&n(new x({xmin:a[0],ymin:a[1],zmin:0,xmax:a[2],ymax:a[3],zmax:0,spatialReference:i}));let o=e=>{e.fullExtent!=null&&(e.type!==`graphics`||!e.internal)&&n(e.fullExtent)};if(this.map?.allLayers.forEach(e=>o(e)),t==null)return null;t.hasZ?(t.zmin=Math.min(0,t.zmin??0),t.zmax=Math.max(0,t.zmax??0)):(t.zmin=0,t.zmax=0);let s=this._get(`_groundAndLayersExtent`);return t.equals(s)?s:t}get environment(){return this._environment}set environment(e){if(this._environment===e)return;let{_environment:t}=this;this._environment=null,t?.destroy(),this._environment=e,this.notifyChange(`environment`)}castEnvironment(e){return e?e instanceof F?e:e instanceof jt?this.environment?.cloneWithWebsceneEnvironment(e)??F.fromWebsceneEnvironment(e):y(F,e):new F}get extent(){return this.stateManager?.extent}set extent(e){this.stateManager&&(this.stateManager.extent=e)}get screenCenter(){return this.stateManager?.screenCenter}get frustum(){return this.stateManager?.frustum}get layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get _layerToLayerviewMapping(){return q._layerToLayerview}static{this._layerToLayerview=A._layerToLayerview.concat([[`view.map.ground.layers`,`view.groundView.layerViews`]])}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||(this.toolViewManager?.interacting??!1)}get stationary(){return!this.animation&&!this.resizing&&(this.state?.stationary??!0)}get navigating(){return this.state?.navigating??!1}get scene(){return this.map&&Pe in this.map?this.map:null}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get featureTiles(){return this._featureTiles}set qualityProfile(e){let t=R(e);t&&this._get(`qualityProfile`)!==e&&(this.qualitySettings=new z(t),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set(`qualityProfile`,e))}get qualityProfile(){return this._get(`qualityProfile`)||st()}_updateSlice(){this.stage!=null&&(this.stage.renderer.slice=this.slice)}get typeSpecificPreconditionsReady(){return this.viewingMode?!!this.stateManager?.preinit(this.spatialReference):!1}get resolution(){let{scale:e,spatialReference:t}=this;return t?he(()=>De(e,t)):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get terrainLevel(){let e=this.basemapTerrain?.tilingScheme,t=this.scale;if(!e||!t)return null;let n=e.levelAtScale(t)+this.qualitySettings.tiledSurface.lodBias,r=e.getMaxLod();return n<=0?null:Math.max(0,Math.min(n,r||1/0))}get heightModelInfo(){let e=this.getDefaultHeightModelInfo();if(!e)return null;let t=de(this.spatialReference);if(t&&e.heightUnit!==t)return new be({heightModel:e.heightModel,heightUnit:t,vertCRS:e.vertCRS,associatedSpatialReference:e.associatedSpatialReference});if(!e.associatedSpatialReference){let t=e.clone();return t.associatedSpatialReference=this.spatialReference,t}return e}get alphaCompositingEnabled(){return this._get(`alphaCompositingEnabled`)}set alphaCompositingEnabled(e){this._stage&&l.getLogger(this).warn(`alphaCompositingEnabled cannot be changed after the view has become ready`),this._set(`alphaCompositingEnabled`,e)}get updating(){if(this.destroying||this.destroyed)return!1;if(!this.initialized)return!0;let e=0,t=this.layerViewManager.updating,n=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach(r=>{if(!r.isFulfilled())++n;else if(r.updating){if(t=!0,r.suspended||pt(r))return;++n,e+=r.updatingProgress}});let r=.1;for(let t of this._updatingObjects)t?.updating&&(n+=r,e+=.5*r);for(let t of this._updatingObjectsWithProgress)t?.updating&&(++n,e+=t.updatingProgress);let i=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||n>0||this.updatingHandles.updating||!this.ready||!this.stationary||i||this._importControllers.size>0||this.inputManager?.updating||this.map?.allLayers?.some(e=>!e.isFulfilled())),t?(this._numUpdating=Math.max(n,this._numUpdating),e+=this._numUpdating-n):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=+!t,this._get(`updatingProgress`)!==e){let n=performance.now();if(e<1){let t=Math.min((n-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set(`updatingProgress`,e),this._lastUpdateTime=t&&e<1?n:0}return L.UPDATING&&console.log(`Updating:`,this._updatingObjectsToDebug.filter(e=>e!=null&&e.updating).map(({declaredClass:e})=>e)),t}get _updatingObjects(){return[this.graphicsView,this.basemapView,this._resourceController,this.stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager,this.focusAreasView]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get _updatingObjectsToDebug(){return L.UPDATING?this._updatingObjects.concat(this._updatingObjectsWithProgress).concat(this.allLayerViews.toArray()):[]}get viewingMode(){let e=this._predeterminedViewingMode;if(e!=null)return j(e);let t=this.spatialReference;return t?this.defaultsFromMap?.viewingMode!=null&&t.equals(this.defaultsFromMap.spatialReference)?j(this.defaultsFromMap.viewingMode):Et(t,1)?`global`:`local`:`global`}set viewingMode(e){this.ready?l.getLogger(this).error(`#viewingMode`,`viewingMode cannot be set once view is ready`):this._overrideIfSome(`viewingMode`,e)}get viewpoint(){return this.stateManager?.viewpoint}set viewpoint(e){this.stateManager&&(this.stateManager.viewpoint=e)}get visibleArea(){return this.stateManager?.visibleArea}get zoom(){return this.stateManager.zoom}set zoom(e){this.stateManager&&(this.stateManager.zoom=e)}get resourceController(){return this._resourceController}get quality(){return this._resourceController?.memoryController?.memoryFactor??1}get resolutionScale(){return Math.sqrt(Math.min(1,this.quality/.75))}get performanceInfo(){return new ut(this)}on(e,t,n,r){return this.viewEvents.on(e,t,n,r)||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return l.getLogger(this).error(`#toMap()`,`Scene view cannot be used before it is ready`),null;let n=G(e)?K(this,e):e;return it(this,n,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return l.getLogger(this).error(`#toScreen()`,`Scene view cannot be used before it is ready`),null;let t=e;return e.z??(t=Ft,t.x=e.x,t.y=e.y,t.z=nt(this.elevationProvider,e)??0,t.spatialReference=e.spatialReference),T(t,Z,this.renderSpatialReference),this.state.camera.projectToScreen(Z,Q),ce(Q[0],Q[1])}pixelSizeAt(e,t){if(!this.ready)return l.getLogger(this).error(`#pixelSizeAt()`,`Scene view cannot be used before it is ready`),null;if(!e)return 0;let n=this.renderSpatialReference;T(e,Z,n);let r=this.state.camera.computeScreenPixelSizeAt(Z);return t&&n!==t?r*fe(n)/fe(t):r}overlayPixelSizeInMapUnits(e){return this.overlayManager?.overlayPixelSizeInMapUnits(e,()=>this.pixelSizeAt(e))??1}hitTest(e,t){if(!this.ready)return l.getLogger(this).error(`#hitTest()`,`Scene view cannot be used before it is ready`),null;let n=G(e)?K(this,e):e;return at(this,n,t,this._defaultHitTestOptions)}async popupHitTest(e){return ot(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async zoomIn(){if(this.canZoomIn)return this.navigation.zoom(!0)}async zoomOut(){if(this.canZoomOut)return this.navigation.zoom(!1)}async whenAnalysisView(e){if(e.parent==null)throw new a(`view:no-analysisview-for-analysis`,`The analysis does not exist in view.analyses`,{analysis:e});switch(e.parent.type){case`line-of-sight`:case`dimension`:case`viewshed`:return(await this.whenLayerView(e.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(e)}}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){let t=await this._completeSettings(e);await this.whenReady();let n=(await this.stage.renderView.takeScreenshot(t))[0];return(await import(`./support/screenshotUtils.js`)).encode(n,t,this._pixelFormat())}async _takeScreenshot(e){let t=await this._completeSettings(e);await this.whenReady();let n=(await this.stage.renderView.takeScreenshot(t))[0];return(await import(`./support/screenshotUtils.js`)).encodeData(n,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){let t=await this._completeSettings(e);t.olidColor=!0,await this.whenReady();let n=await this.stage.renderView.takeScreenshot(t),{encodeData:r}=await import(`./support/screenshotUtils.js`);return[r(n[0],this._pixelFormat()),r(n[1],this._pixelFormat())]}async _completeSettings(e){let{toRenderSettings:t,screenshotSuperSampleSettings:n}=await import(`./support/screenshotUtils.js`),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,n(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!yt())throw new a(`360vr:objectAndLayerId-rendering-disabled`,`has enable-feature:objectAndLayerId-rendering must be true`);let{encode:t}=await import(`./support/screenshotUtils.js`),n=await this._completeSettings(e);n.olidColor=!0,await this.whenReady();let r=await this.stage.renderView.takeScreenshot(n),i=t(r[0],n,this._pixelFormat()),o=await this._completeSettings(e);return o.format=`png`,[i,t(r[1],o,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){let e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new a(`360vr:objectAndLayerId-rendering-disabled`,`has enable-feature:objectAndLayerId-rendering must be true`)}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}getAttributionItems(){return super.getAttributionItems().concat(this.attribution3D.attributionItems)}importLayerView(e){return N.importLayerView(e)}hasLayerViewModule(e){return N.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getWebDocumentSpatialReference(){return this.scene?.initialViewProperties?.spatialReference}getDefaultTimeZone(){return this.scene?.initialViewProperties?.timeZone??null}getSurface(){return this.surface}get _predeterminedViewingMode(){let e=this._isOverridden(`viewingMode`)?this._get(`viewingMode`):this.scene?.initialViewProperties?.viewingMode;return e==null?null:M(e)}getSpatialReferenceSupport(e,t){let n=this._predeterminedViewingMode,r=r=>this._validateSpatialReferenceForViewingMode(e,t,r)?this._makeSpatialReferenceConstraints(e,t,r,n):null,i=n?r(n):[...r(1)??[],...r(2)??[]];return i?.length?{constraints:i}:null}_validateSpatialReferenceForViewingMode(e,t,n){return Et(e,n)?t==null||E(t)?!0:!(D(t)&&mt(t,e,n)==null||O(t)&&n===1):!1}_makeSpatialReferenceConstraints(e,t,n,r){if(t==null)return[{spatialReference:e,viewingMode:n}];let{isWebMercator:i,isWGS84:a,vcsWkid:o,latestVcsWkid:s}=e,c=()=>o==null?i?w.WGS84:w.WebMercator:new w({...i?Oe:ke,vcsWkid:o,latestVcsWkid:s});return E(t)&&(i||a)?!(a&&r!==2)||ht(t.tileInfo,t.fullExtent,e,1)===null?[{spatialReference:e,viewingMode:n},{spatialReference:c(),viewingMode:n}]:[{spatialReference:c(),viewingMode:n}]:!D(t)&&!O(t)&&(i||a)?[{spatialReference:e,viewingMode:n},{spatialReference:c(),viewingMode:n}]:D(t)&&i&&n!==1?[{spatialReference:e,viewingMode:n},{spatialReference:c(),viewingMode:2}]:[{spatialReference:e,viewingMode:n}]}_validateSpatialReference(e){let t=this.getSpatialReferenceSupport(e)!=null,n=this._predeterminedViewingMode;return t||(n==null?e.isGeographic&&l.getLogger(this).warnOnce(`Spatial reference is geographic but not supported.`):l.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${j(n)} viewing mode.`)),t}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}trackGraphicState(e){if(!e.graphic)return l.getLogger(this).error(`trackGraphicState`,`GraphicState.graphic must not be null or undefined to start tracking`),null;let t=this.getViewForGraphic(e.graphic),n=null,r=!1,i=t=>{!r&&t!=null&&`processor`in t&&t.processor?.type===`graphics-3d`&&t.processor.graphicsCore&&(n=t.processor.graphicsCore.trackGraphicState(e))};return t==null?this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then(e=>i(e),()=>{}).catch(()=>{}):i(t),c(()=>{r=!0,n!=null&&(n.remove(),n=null)})}maskOccludee(e){if(!e)return l.getLogger(this).error(`maskOccludee`,`GraphicState.graphic must not be null or undefined to mask an occludee`),null;let t=this.getViewForGraphic(e),n=null,r=!1,i=t=>{!r&&t!=null&&Tt(t)&&(n=t.maskOccludee(e))};return t==null?this.whenViewForGraphic(e,{waitForLayer:!0}).then(e=>i(e),()=>{}).catch(()=>{}):i(t),c(()=>{r=!0,n!=null&&(n.remove(),n=null)})}getViewForGraphic(e){return e.layer===this?this.graphicsView:e.layer?this.allLayerViews.filter(e=>e.type!==`media-3d`).find(t=>t.layer===e.layer):null}graphicChanged(e){this.graphicsView!=null&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await ae(()=>this.graphicsView),this.graphicsView):!e.layer||!this.map?null:!t||!t.waitForLayer||this.map.allLayers.includes(e.layer)?this.whenLayerView(e.layer):new Promise((t,n)=>{let r=this.map.allLayers.on(`change`,i=>{i.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,n))})})}enableFeatureTiles(){let e=Symbol();return this._featureTileTreeClients.add(e),c(()=>this._featureTileTreeClients.delete(e))}async _importModule(e,t){let n=new AbortController;this._importControllers.set(e,n),this._updatingChanged();try{let r=await It[e]();if(t&&(ne(this),d(n.signal),await t(n.signal)),this.destroyed)throw re();return d(n.signal),r}catch{return null}finally{this._importControllers.delete(e),this._updatingChanged()}}_abortImport(e){this._importControllers.get(e)?.abort(),this._importControllers.delete(e),this._updatingChanged()}_initBasemapTerrain(){this._set(`basemapTerrain`,new V({view:this})),this.elevationProvider.register(0,this.basemapTerrain)}_exitBasemapTerrain(){let{basemapTerrain:e,elevationProvider:t}=this;e&&(this._set(`basemapTerrain`,null),t.unregister(e),e.destroy())}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set(`pointsOfInterest`,new B({view:this})),this.addHandles([this.updatingHandles.add(()=>L.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import(`./3d/layers/support/FeatureTileTree3DDebugger.js`)).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&L.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||(this._featureTreeDebugger=u(this._featureTreeDebugger))},g),this.updatingHandles.add(()=>({basemapExtent:this.groundView?.groundExtent,basemapSpatialReference:this.groundView?.spatialReference,clippingArea:this.clippingArea,featureTiles:this._featureTiles}),({basemapExtent:e,basemapSpatialReference:t,clippingArea:n,featureTiles:r})=>{if(!r)return;let i=!!e;if(!n&&!i)r.filterExtent=null;else if(!i||!t)r.filterExtent=n;else{let i=e&&t?C(we(e,t),this.spatialReference):null;r.filterExtent=n?n.intersection(i):i}},g),this.updatingHandles.add(()=>this._featureTileTreeClients.size>0,e=>{e?this.updatingHandles.consumePromise(this._ensureFeatureTileTree()):this._featureTiles=u(this._featureTiles)},h)],Nt),this.stateManager.init()}async _ensureFeatureTileTree(){if(this._featureTiles||this._importControllers.has(`FeatureTileTree3D`))return;let e=(await this.updatingHandles.addPromise(this._importModule(`FeatureTileTree3D`)))?.FeatureTileTree3D;e&&(this._featureTiles=new e({renderCoordsHelper:this.renderCoordsHelper,pointsOfInterest:this.pointsOfInterest,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}),this._updatingChanged())}_exitTerrain(){this.stateManager.exit(),this.removeHandles(J),this.removeHandles(Nt),this._featureTiles=u(this.featureTiles),this._set(`pointsOfInterest`,u(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem()}_initCoordinateSystem(){if(this.spatialReference){let e=this.spatialReference,t=this.state.isGlobal,n=Ee(t,e);n!==this.renderSpatialReference&&(this._set(`renderCoordsHelper`,ct.create(this.state.viewingMode,n)),t||this.addHandles(p(()=>this.groundView?.groundExtent,e=>{let t=this.renderCoordsHelper.spatialReference;e!=null&&(e[0]!==0||e[1]!==0||e[2]!==0||e[3]!==0)&&Ce(e,this.groundView.spatialReference,$,t)&&(this.renderCoordsHelper.extent=$)},h),J),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(H/this.renderCoordsHelper.unitInMeters))}else this._set(`renderCoordsHelper`,null)}_exitCoordinateSystem(){this.removeHandles(J),this._set(`renderCoordsHelper`,null)}_updatingChanged(){this.notifyChange(`updating`)}_updateUpdatingMonitors(e=null){(e==null||e.type!==4)&&(this.removeHandles(`updatingMonitors`),this.allLayerViews.forEach(e=>{e.destroyed||(this.addHandles(p(()=>[e.updating,e.updatingProgress],()=>this._updatingChanged(),h),`updatingMonitors`),e.when(()=>this._updatingChanged(),()=>this._updatingChanged()))}),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,n){if(!this.overlay||!this.overlay.hasVisibleItems)return n;let r=e.getContext(`2d`,{willReadFrequently:!0});return r.putImageData(n,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,n.width,n.height)}_initStage(){let e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,n)=>this._renderScreenshotOverlay(e,t,n)}},t=new Qe(this.state.viewingMode,e=>this.stage.layers.forEach(e),this);this._set(`sceneIntersectionHelper`,t);let n=i(this.surface);this._stage=new vt({view:this,options:e,container:n}),this.notifyChange(`stage`),this._updateSlice(),this.addHandles([this.on(`pointer-move`,()=>this.stage?.renderer.resetAnimation()),o(this.stage.renderView.canvas,`webglcontextlost`,e=>{this.fatalError=new a(`webgl-context-lost`,e.statusMessage||`WebGL context lost`)})],`stage`),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(H/this.renderCoordsHelper.unitInMeters),this._set(`canvas`,this.stage.renderView.canvas)}_exitStage(){this.sceneIntersectionHelper?.destroy(),this._set(`sceneIntersectionHelper`,null),this._stage=u(this.stage),this._set(`stage`,null),this.removeHandles(`stage`),this._set(`canvas`,null)}_initSurface(){this._exitSurface(),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new dt({view:this,resourceController:this._resourceController})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitTerrain(),this._exitStage())}async _ensureGraphicsView(){if(this.graphicsView||this._importControllers.has(`GraphicsView3D`)||this.graphics.length===0)return;this.removeHandles(`GraphicsView3D`);let e=(await this.updatingHandles.addPromise(this._importModule(`GraphicsView3D`,e=>ae(()=>this.groundView?.ready,e))))?.default;e&&this._set(`graphicsView`,new e({view:this,getGraphics:()=>this.graphics})),this._updatingChanged()}_disposeGraphicsView(){this._abortImport(`GraphicsView3D`),this.removeHandles(`GraphicsView3D`),this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set(`graphicsView`,null))}_disposeFocusAreasView(){this._abortImport(`FocusAreasView`),this.removeHandles(`FocusAreasView`),this.focusAreasView=u(this.focusAreasView)}async _ensureFocusAreasView(e){if(this.focusAreasView||this._importControllers.has(`FocusAreasView`)||e===0)return;this.removeHandles(`FocusAreasView`);let t=(await this.updatingHandles.addPromise(this._importModule(`FocusAreasView`)))?.FocusAreasView;t&&(this.focusAreasView=new t({view:this})),this._updatingChanged()}_startup(){M(this.viewingMode)===1&&(this._clippingArea=null),this._initSurface(),this._set(`ready`,!0),this.addHandles(f(()=>this.graphics,`after-changes`,()=>this._ensureGraphicsView()),`GraphicsView3D`),this._ensureGraphicsView(),this.addHandles(this.updatingHandles.add(()=>this.map?.focusAreas?.areas.length??0,e=>this._ensureFocusAreasView(e),{initial:!0}),`FocusAreasView`);let e=this.scene?.initialViewProperties??null,t=e?.environment;t&&(this._overrideDefaultEnvironmentOnly?me(this.environment,t):this.environment=this.environment.cloneWithWebsceneEnvironment(t)),this.timeExtent=e?.timeExtent,e?.analyses.applyTo(this),this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect();let n=this._resolveWhenReady;this._resolveWhenReady=[],n.forEach(e=>e(this))}_teardown(){this.inputManager.disconnect(),this.environmentManager.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this._exitSurface(),this._set(`ready`,!1)}get _defaultToMapOptions(){let e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(U);for(let t of this.allLayerViews)(k(t.layer)&&(!has(`enable-feature:im-as-ground`)||t.layer.isUsedAsGroundLayer)||je(t.layer))&&e.include.add(t.uid);return e}get _defaultHitTestOptions(){let e={exclude:new Set};if(!this.map)return e;this.map.ground&&this.map.ground.opacity<1&&e.exclude.add(U);for(let t of this.allLayerViews)(has(`enable-feature:im-as-ground`)?k(t.layer)&&t.layer.isUsedAsGroundLayer:k(t.layer))&&t.fullOpacity<1&&e.exclude.add(t.uid);return e}static{this.type=`3d`}static clearStatics(){Mt(),ge(),ue(),St(),Xe(),Ve(),Se(),wt(),Ne(),_t(),xt(),Ze(),$e(),ve(),se(),bt(),gt(),Ke.cleanupI3SLodHandling(),Me.cleanupTilemapCache(),I.cleanupViewstate(),V.cleanupTerrainSurface()}};e([_({nonNullable:!0}),v(Pt)],Y.prototype,`options`,void 0),e([_()],Y.prototype,`_userClippingArea`,void 0),e([_()],Y.prototype,`_resourceController`,void 0),e([_()],Y.prototype,`stage`,null),e([_({readOnly:!0})],Y.prototype,`deconflictor`,void 0),e([_({readOnly:!0})],Y.prototype,`labeler`,void 0),e([_()],Y.prototype,`navigation`,void 0),e([_({type:Re,readOnly:!0})],Y.prototype,`animation`,null),e([_({readOnly:!0})],Y.prototype,`basemapTerrain`,void 0),e([_({readOnly:!0})],Y.prototype,`overlayManager`,null),e([_({readOnly:!0})],Y.prototype,`elevationProvider`,void 0),e([_()],Y.prototype,`camera`,null),e([_({type:t})],Y.prototype,`contentCamera`,null),e([_({readOnly:!0})],Y.prototype,`canvas`,null),e([_({type:S,useTypeForAutocast:!1})],Y.prototype,`center`,null),e([_({type:x})],Y.prototype,`clippingArea`,null),e([_({type:P,nonNullable:!0})],Y.prototype,`constraints`,void 0),e([_({type:x,readOnly:!0})],Y.prototype,`renderDataExtent`,null),e([_({readOnly:!0})],Y.prototype,`tileInfo`,null),e([_({type:x,readOnly:!0})],Y.prototype,`dataExtent`,null),e([_({type:x,readOnly:!0})],Y.prototype,`_groundAndLayersExtent`,null),e([_({type:F})],Y.prototype,`environment`,null),e([v(`environment`)],Y.prototype,`castEnvironment`,null),e([_({readOnly:!0})],Y.prototype,`environmentManager`,void 0),e([_({type:x})],Y.prototype,`extent`,null),e([_({type:r})],Y.prototype,`floors`,void 0),e([_()],Y.prototype,`screenCenter`,null),e([_()],Y.prototype,`frustum`,null),e([_({type:Number,readOnly:!0})],Y.prototype,`fullOpacity`,void 0),e([_({readOnly:!0})],Y.prototype,`graphicsView`,void 0),e([_()],Y.prototype,`analysisViewManager`,void 0),e([_()],Y.prototype,`groundView`,void 0),e([_({readOnly:!0})],Y.prototype,`layerviewCollections`,null),e([_({type:Boolean})],Y.prototype,`initialExtentRequired`,null),e([_()],Y.prototype,`defaultsFromMapSettings`,null),e([_()],Y.prototype,`interacting`,null),e([_()],Y.prototype,`stationary`,null),e([_()],Y.prototype,`navigating`,null),e([_()],Y.prototype,`map`,void 0),e([_()],Y.prototype,`padding`,null),e([_({type:B,readOnly:!0})],Y.prototype,`pointsOfInterest`,void 0),e([_()],Y.prototype,`_featureTiles`,void 0),e([_()],Y.prototype,`featureTiles`,null),e([_()],Y.prototype,`_featureTreeDebugger`,void 0),e([_({constructOnly:!0})],Y.prototype,`deactivatedWebGLExtensions`,void 0),e([_({constructOnly:!0})],Y.prototype,`debugWebGLExtensions`,void 0),e([_({constructOnly:!0})],Y.prototype,`renderCanvas`,void 0),e([_({constructOnly:!0})],Y.prototype,`state`,void 0),e([_()],Y.prototype,`screenSizePerspective`,void 0),e([_({readOnly:!0})],Y.prototype,`inputManager`,void 0),e([_({readOnly:!0})],Y.prototype,`stateManager`,void 0),e([_({type:[`low`,`medium`,`high`]})],Y.prototype,`qualityProfile`,null),e([_({type:z,get(){let e=this._get(`qualitySettings`);if(!e){let t=R(this.qualityProfile);e=new z(t)}return e}})],Y.prototype,`qualitySettings`,void 0),e([_()],Y.prototype,`slice`,void 0),e([_({readOnly:!0})],Y.prototype,`typeSpecificPreconditionsReady`,null),e([_({readOnly:!0})],Y.prototype,`renderCoordsHelper`,void 0),e([_({readOnly:!0})],Y.prototype,`sceneIntersectionHelper`,void 0),e([_({type:Number,readOnly:!0})],Y.prototype,`resolution`,null),e([_({type:Number})],Y.prototype,`scale`,null),e([_({readOnly:!0,type:Number})],Y.prototype,`terrainLevel`,null),e([_()],Y.prototype,`heightModelInfo`,null),e([_({type:w})],Y.prototype,`spatialReference`,void 0),e([_({type:Boolean,value:!1})],Y.prototype,`alphaCompositingEnabled`,null),e([_({constructOnly:!0})],Y.prototype,`preserveDrawingBufferEnabled`,void 0),e([_({type:Boolean})],Y.prototype,`supersampleScreenshotsEnabled`,void 0),e([_({readOnly:!0})],Y.prototype,`type`,void 0),e([_(),v(e=>e instanceof kt?e:b(At,e))],Y.prototype,`ui`,void 0),e([_({type:Boolean,readOnly:!0})],Y.prototype,`updating`,null),e([_()],Y.prototype,`_updatingObjects`,null),e([_()],Y.prototype,`_updatingObjectsWithProgress`,null),e([_()],Y.prototype,`_updatingObjectsToDebug`,null),e([_({type:Number,readOnly:!0})],Y.prototype,`updatingProgress`,void 0),e([_({type:[`global`,`local`]})],Y.prototype,`viewingMode`,null),e([_({type:n})],Y.prototype,`viewpoint`,null),e([_({readOnly:!0})],Y.prototype,`visibleArea`,null),e([_({type:Number})],Y.prototype,`zoom`,null),e([_({readOnly:!0})],Y.prototype,`quality`,null),e([_({readOnly:!0})],Y.prototype,`resolutionScale`,null),e([_()],Y.prototype,`focusAreasView`,void 0),e([_()],Y.prototype,`_defaultToMapOptions`,null),e([_()],Y.prototype,`_defaultHitTestOptions`,null),Y=q=e([pe(`esri.views.SceneView`)],Y);function X(e,t){return e!=null&&xe(e.spatialReference,t)?C(e,t):null}const Z=_e(),Q=le(),$=Te(),Ft=Ae(0,0,0,w.WebMercator),It={GraphicsView3D:()=>import(`./3d/layers/GraphicsView3D.js`),FocusAreasView:()=>import(`./3d/FocusAreasView.js`),FeatureTileTree3D:()=>import(`./3d/layers/support/FeatureTileTree3D.js`)},Lt=Y;export{Lt as default};
2
+ import{__decorate as e}from"tslib";import t from"../Camera.js";import n from"../Viewpoint.js";import r from"../core/Collection.js";import{byId as i}from"../core/domUtils.js";import a from"../core/Error.js";import{on as o}from"../core/events.js";import{destroyHandle as s,makeHandle as c}from"../core/handleUtils.js";import has from"../core/has.js";import l from"../core/Logger.js";import{mapCollectionAsync as ee}from"../core/mapCollectionUtils.js";import{destroyMaybe as u,maybeProperty as te}from"../core/maybe.js";import{throwIfDestroyed as ne,throwIfAborted as d,createAbortError as re}from"../core/promiseUtils.js";import ie from"../core/ReactiveSet.js";import{on as f,watch as p,initial as m,sync as h,whenOnce as ae,syncAndInitial as g}from"../core/reactiveUtils.js";import{setFrameDuration as oe,cleanupScheduling as se}from"../core/scheduling.js";import{createScreenPoint as ce,createScreenPointArray as le}from"../core/screenUtils.js";import{cleanupWhereClauseCache as ue}from"../core/sql.js";import{getDefaultVerticalUnitStringForSR as de,getMetersPerUnitForSR as fe}from"../core/units.js";import{property as _,cast as v,subclass as pe}from"../core/accessorSupport/decorators.js";import{ensureType as y,ensureClass as b}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as me}from"../core/accessorSupport/overrideDefaultsFrom.js";import{runUntracked as he}from"../core/accessorSupport/tracking.js";import{drainNotificationQueue as ge}from"../core/accessorSupport/trackingUtils.js";import{create as _e}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as ve}from"../core/libs/rbush/PooledRBush.js";import{initialize as ye}from"../core/workers/workers.js";import x from"../geometry/Extent.js";import be from"../geometry/HeightModelInfo.js";import S from"../geometry/Point.js";import{project as C,canProjectWithoutEngine as xe}from"../geometry/projectionUtils.js";import w from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as Se}from"../geometry/spatialReferenceEllipsoidUtils.js";import{projectBoundingRect as Ce}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as T}from"../geometry/projection/projectPointToVector.js";import{toExtent as we,create as Te}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as Ee}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as De}from"../geometry/support/scaleUtils.js";import{wgs84 as Oe,webMercator as ke}from"../geometry/support/spatialReferenceUtils.js";import{makeDehydratedPoint as Ae}from"../layers/graphics/dehydratedPoint.js";import{isImageryTileLayer as E,isTiledLayer as D,isVoxelLayer as O,isIntegratedMeshLayer as k,isGaussianSplatLayer as je}from"../layers/support/layerUtils.js";import{TilemapCache as Me}from"../layers/support/TilemapCache.js";import{clearDefaultPortalInstance as Ne}from"../portal/portalDefault.js";import{WebSceneTag as Pe}from"../support/tagSymbols.js";import{BreakpointsOwner as Fe}from"./BreakpointsOwner.js";import{DOMContainer as Ie}from"./DOMContainer.js";import{PopupView as Le}from"./PopupView.js";import A from"./View.js";import Re from"./ViewAnimation.js";import{stringFromViewingMode as j,viewingModeFromString as M}from"./ViewingMode.js";import{GroundView3D as ze}from"./3d/GroundView3D.js";import{layerView3DImporter as N}from"./3d/layerViewModuleImportUtils.js";import{importAnalysisViewModule as Be}from"./3d/analysis/analysisViewModuleImportUtils.js";import{cleanupIntersectionUtils as Ve}from"./3d/camera/intersectionUtils.js";import P from"./3d/constraints/Constraints.js";import F from"./3d/environment/Environment.js";import{EnvironmentView as He}from"./3d/environment/EnvironmentView.js";import Ue from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as We}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as Ge}from"./3d/layers/graphics/Labeler.js";import Ke from"./3d/layers/i3s/I3SLodHandling.js";import{Navigation3D as qe}from"./3d/navigation/Navigation3D.js";import{ScreenSizePerspective as Je}from"./3d/state/ScreenSizePerspective.js";import I from"./3d/state/ViewState.js";import{ViewStateManager as Ye,cleanupViewStateManager as Xe}from"./3d/state/ViewStateManager.js";import{cleanupPointToPointAnimationController as Ze}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as Qe}from"./3d/state/helpers/SceneIntersectionHelper.js";import{cleanupNavigationUtils as $e}from"./3d/state/utils/navigationUtils.js";import et from"./3d/support/Attribution3D.js";import{CombinedElevationProvider as tt}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as L}from"./3d/support/debugFlags.js";import{getElevationAtPoint as nt}from"./3d/support/ElevationProvider.js";import{GroundAndIMSurface as rt}from"./3d/support/GroundAndIMSurface.js";import{toMap as it,hitTest as at}from"./3d/support/hitTest.js";import{popupHitTest as ot}from"./3d/support/popupHitTest.js";import{getDefaultQualityProfileName as st,getQualityProfileSettings as R}from"./3d/support/QualityProfile.js";import z from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as ct}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as lt}from"./3d/support/ResourceController.js";import ut from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as dt}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as ft}from"./3d/support/ViewSlice.js";import{PointsOfInterest as B}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import V from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as pt,getTiledLayerInfo as mt,checkIfTileInfoSupportedForView as ht}from"./3d/terrain/terrainUtils.js";import{clearTilePerLayerInfo as gt}from"./3d/terrain/TilePerLayerInfo.js";import{cleanupTileRenderer as _t}from"./3d/terrain/TileRenderer.js";import{Stage as vt}from"./3d/webgl-engine/Stage.js";import{olidEnabled as yt}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{cleanupRenderOccluded as bt}from"./3d/webgl-engine/effects/geometry/RenderOccluded.js";import{defaultTolerance as H}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as xt}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as U}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{cleanupEdgeProcessing as St}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import W from"./interactive/options/ViewOptions.js";import Ct from"./support/AnalysisViewManager.js";import{cleanupDrapedUtils as wt}from"./support/drapedUtils.js";import{occludeesSupported as Tt}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as G,createScreenPointFromSupportedEvent as K}from"./support/screenUtils.js";import{isSpatialReferenceSupported as Et}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as Dt,destroyTextureCompressionWorker as Ot}from"./support/TextureCompressionHelper.js";import kt from"./ui/DefaultUI.js";import At from"./ui/3d/DefaultUI3D.js";import jt from"../webscene/Environment.js";import{clearVNodeCache as Mt}from"../widgets/support/vnodeCache.js";var q;const Nt=Symbol(),J=Symbol();function Pt(e){let t=b(W,e);return t!==e&&e.snapping?.enabled==null&&(t.snapping.enabled=!0),t}let Y=class extends Fe(Le(Ie(A))){static{q=this}get timeZone(){return super.timeZone}set timeZone(e){super.timeZone=e}constructor(e){super(e),this.options=new W({snapping:{enabled:!0}}),this._userClippingArea=null,this._clippingArea=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=lt(this),this.deconflictor=new We({view:this}),this.attribution3D=new et({view:this}),this.labeler=new Ge({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.navigation=new qe({view:this}),this.basemapTerrain=null,this.elevationProvider=new tt({view:this}),this._canvas=null,this.constraints=new P,this._environment=new F,this.environmentView=new He,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new Ct({importAnalysisViewModule:e=>Be(e),view:this}),this.groundView=null,this.groundAndIMSurface=null,this.map=null,this._featureTileTreeClients=new ie,this._featureTiles=null,this._featureTreeDebugger=null,this.state=new I({view:this}),this.slice=new ft,this.spatialReference=null,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type=`3d`,this.ui=new At,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,ye();let t=()=>this._updatingChanged();this.addHandles(s(ee(()=>this.map?.allLayers,async e=>{try{await e.when()}catch{}finally{t()}}))),this.addHandles([f(()=>this.map?.allLayers,`after-changes`,t,{onListenerAdd:t,onListenerRemove:t,sync:!0}),this.allLayerViews.on(`after-changes`,e=>this._updateUpdatingMonitors(e)),p(()=>this.scene,e=>e?.load().catch(()=>{}))]),this.inputManager=new Ue({view:this}),this.stateManager=new Ye({view:this}),this.screenSizePerspective=new Je({view:this})}initialize(){if(has(`enable-feature:esri-compress-textures`)&&has(`wasm-simd`)){let e=Dt(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new ze({view:this}),this.groundAndIMSurface=new rt({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},m),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},m),this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,e=>oe(e>0?1e3/Math.ceil(e):0),m),this.addHandles([p(()=>this.spatialReference,()=>this.notifyChange(`clippingArea`),h),p(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),h)])}destroy(){this.destroyed||(Ot(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),this.elevationProvider.destroy(),this.ui.removeAllHandles(),this.layerViewManager.clearHandles(),this.invalidate(),this.layerViewManager.clear(),this._set(`analysisViewManager`,u(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this.sharedSymbolResources=u(this.sharedSymbolResources),this._set(`labeler`,u(this.labeler)),this._set(`deconflictor`,u(this.deconflictor)),this._resourceController=u(this._resourceController),this._set(`stateManager`,u(this.stateManager)),this._set(`inputManager`,u(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this.removeHandles(`updatingMonitors`),this._set(`environmentView`,u(this.environmentView)),this._set(`environment`,u(this.environment)),this.groundView=u(this.groundView),this.groundAndIMSurface.destroy(),this.slice.destroy(),this._updatingObjectsWithProgress.length=0,this._updatingObjects.length=0,this.ui?.destroy(),this._set(`ui`,null),this._set(`renderCanvas`,null),this._set(`canvas`,null),this._canvas=null,this.screenSizePerspective.destroy(),this.attribution3D.destroy())}get stage(){return this._stage}get renderSpatialReference(){return this.renderCoordsHelper?.spatialReference}get groundSpatialReference(){return this.groundView?.spatialReference}get analyses(){return super.analyses}set analyses(e){super.analyses=e}get animation(){return this.state?.animation}get overlayManager(){return this.basemapTerrain?.overlayManager}get camera(){return this.stateManager?.camera}set camera(e){this.stateManager&&(this.stateManager.camera=e)}get contentCamera(){return this.stateManager?.contentCamera}set contentCamera(e){this.stateManager&&(this.stateManager.contentCamera=e)}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get canvas(){return this._canvas}get center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=y(S,e))}get clippingArea(){if(this.viewingMode===`global`)return null;let e=this.map,t=this._userClippingArea||te(e,`clippingArea`);return!(this._userClippingArea||te(e,`clippingEnabled`))||t==null?(this._clippingArea=null,null):t instanceof x?this.spatialReference&&(t=X(t,this.spatialReference),t==null)?(l.getLogger(this).error(`#clippingArea`,`setting clippingArea with incompatible SpatialReference`),this._clippingArea):(t=t.clone(),t.intersection(this._groundAndLayersExtent)??(t.xmin=t.xmax,t.ymin=t.ymax),t.zmin=void 0,t.zmax=void 0,t.equals(this._clippingArea)||(this._clippingArea=t),this._clippingArea):(l.getLogger(this).error(`#clippingArea`,`only clippingArea geometries of type Extent are supported`),this._clippingArea)}set clippingArea(e){this.ready&&this.viewingMode===`global`&&e!=null?l.getLogger(this).error(`#clippingArea=`,`Clipping area is only supported in local viewingMode`):this._userClippingArea=e}get renderDataExtent(){if(this.state.viewingMode===1)return null;let e=this.renderSpatialReference,t=this.dataExtent;return t==null||e==null||t.spatialReference.equals(e)?t:X(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent,t=this.spatialReference||w.WGS84,n=X(this.clippingArea,t);n!=null&&(e=e==null?n:e.intersection(n));let r=this._get(`dataExtent`);return e!=null&&e.equals(r)?r:e}get _groundAndLayersExtent(){let e=this.spatialReference||w.WGS84,t,n=n=>{let r=X(n,e);r!=null&&(t==null?t=r.clone():t.union(r))},{groundView:r}=this,i=r?.spatialReference,a=r?.fullGroundExtent;i&&a&&n(new x({xmin:a[0],ymin:a[1],zmin:0,xmax:a[2],ymax:a[3],zmax:0,spatialReference:i}));let o=e=>{e.fullExtent!=null&&(e.type!==`graphics`||!e.internal)&&n(e.fullExtent)};if(this.map?.allLayers.forEach(e=>o(e)),t==null)return null;t.hasZ?(t.zmin=Math.min(0,t.zmin??0),t.zmax=Math.max(0,t.zmax??0)):(t.zmin=0,t.zmax=0);let s=this._get(`_groundAndLayersExtent`);return t.equals(s)?s:t}get environment(){return this._environment}set environment(e){if(this._environment===e)return;let{_environment:t}=this;this._environment=null,t?.destroy(),this._environment=e,this.notifyChange(`environment`)}castEnvironment(e){return e?e instanceof F?e:e instanceof jt?this.environment?.cloneWithWebsceneEnvironment(e)??F.fromWebsceneEnvironment(e):y(F,e):new F}get extent(){return this.stateManager?.extent}set extent(e){this.stateManager&&(this.stateManager.extent=e)}get screenCenter(){return this.stateManager?.screenCenter}get frustum(){return this.stateManager?.frustum}get layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get _layerToLayerviewMapping(){return q._layerToLayerview}static{this._layerToLayerview=A._layerToLayerview.concat([[`view.map.ground.layers`,`view.groundView.layerViews`]])}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||(this.toolViewManager?.interacting??!1)}get stationary(){return!this.animation&&!this.resizing&&(this.state?.stationary??!0)}get navigating(){return this.state?.navigating??!1}get scene(){return this.map&&Pe in this.map?this.map:null}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get featureTiles(){return this._featureTiles}set qualityProfile(e){let t=R(e);t&&this._get(`qualityProfile`)!==e&&(this.qualitySettings=new z(t),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set(`qualityProfile`,e))}get qualityProfile(){return this._get(`qualityProfile`)||st()}_updateSlice(){this.stage!=null&&(this.stage.renderer.slice=this.slice)}get typeSpecificPreconditionsReady(){return this.viewingMode?!!this.stateManager?.preinit(this.spatialReference):!1}get resolution(){let{scale:e,spatialReference:t}=this;return t?he(()=>De(e,t)):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get terrainLevel(){let e=this.basemapTerrain?.tilingScheme,t=this.scale;if(!e||!t)return null;let n=e.levelAtScale(t)+this.qualitySettings.tiledSurface.lodBias,r=e.getMaxLod();return n<=0?null:Math.max(0,Math.min(n,r||1/0))}get heightModelInfo(){let e=this.getDefaultHeightModelInfo();if(!e)return null;let t=de(this.spatialReference);if(t&&e.heightUnit!==t)return new be({heightModel:e.heightModel,heightUnit:t,vertCRS:e.vertCRS,associatedSpatialReference:e.associatedSpatialReference});if(!e.associatedSpatialReference){let t=e.clone();return t.associatedSpatialReference=this.spatialReference,t}return e}get alphaCompositingEnabled(){return this._get(`alphaCompositingEnabled`)}set alphaCompositingEnabled(e){this._stage&&l.getLogger(this).warn(`alphaCompositingEnabled cannot be changed after the view has become ready`),this._set(`alphaCompositingEnabled`,e)}get updating(){if(this.destroying||this.destroyed)return!1;if(!this.initialized)return!0;let e=0,t=this.layerViewManager.updating,n=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach(r=>{if(!r.isFulfilled())++n;else if(r.updating){if(t=!0,r.suspended||pt(r))return;++n,e+=r.updatingProgress}});let r=.1;for(let t of this._updatingObjects)t?.updating&&(n+=r,e+=.5*r);for(let t of this._updatingObjectsWithProgress)t?.updating&&(++n,e+=t.updatingProgress);let i=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||n>0||this.updatingHandles.updating||!this.ready||!this.stationary||i||this._importControllers.size>0||this.inputManager?.updating||this.map?.allLayers?.some(e=>!e.isFulfilled())),t?(this._numUpdating=Math.max(n,this._numUpdating),e+=this._numUpdating-n):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=+!t,this._get(`updatingProgress`)!==e){let n=performance.now();if(e<1){let t=Math.min((n-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set(`updatingProgress`,e),this._lastUpdateTime=t&&e<1?n:0}return L.UPDATING&&console.log(`Updating:`,this._updatingObjectsToDebug.filter(e=>e!=null&&e.updating).map(({declaredClass:e})=>e)),t}get _updatingObjects(){return[this.graphicsView,this.basemapView,this._resourceController,this.stage,this.featureTiles,this.pointsOfInterest,this.environmentView,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager,this.focusAreasView]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get _updatingObjectsToDebug(){return L.UPDATING?this._updatingObjects.concat(this._updatingObjectsWithProgress).concat(this.allLayerViews.toArray()):[]}get viewingMode(){let e=this._predeterminedViewingMode;if(e!=null)return j(e);let t=this.spatialReference;return t?this.defaultsFromMap?.viewingMode!=null&&t.equals(this.defaultsFromMap.spatialReference)?j(this.defaultsFromMap.viewingMode):Et(t,1)?`global`:`local`:`global`}set viewingMode(e){this.ready?l.getLogger(this).error(`#viewingMode`,`viewingMode cannot be set once view is ready`):this._overrideIfSome(`viewingMode`,e)}get viewpoint(){return this.stateManager?.viewpoint}set viewpoint(e){this.stateManager&&(this.stateManager.viewpoint=e)}get visibleArea(){return this.stateManager?.visibleArea}get zoom(){return this.stateManager.zoom}set zoom(e){this.stateManager&&(this.stateManager.zoom=e)}get resourceController(){return this._resourceController}get quality(){return this._resourceController?.memoryController?.memoryFactor??1}get resolutionScale(){return Math.sqrt(Math.min(1,this.quality/.75))}get performanceInfo(){return new ut(this)}on(e,t,n,r){return this.viewEvents.on(e,t,n,r)||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return l.getLogger(this).error(`#toMap()`,`Scene view cannot be used before it is ready`),null;let n=G(e)?K(this,e):e;return it(this,n,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return l.getLogger(this).error(`#toScreen()`,`Scene view cannot be used before it is ready`),null;let t=e;return e.z??(t=Ft,t.x=e.x,t.y=e.y,t.z=nt(this.elevationProvider,e)??0,t.spatialReference=e.spatialReference),T(t,Z,this.renderSpatialReference),this.state.camera.projectToScreen(Z,Q),ce(Q[0],Q[1])}pixelSizeAt(e,t){if(!this.ready)return l.getLogger(this).error(`#pixelSizeAt()`,`Scene view cannot be used before it is ready`),null;if(!e)return 0;let n=this.renderSpatialReference;T(e,Z,n);let r=this.state.camera.computeScreenPixelSizeAt(Z);return t&&n!==t?r*fe(n)/fe(t):r}overlayPixelSizeInMapUnits(e){return this.overlayManager?.overlayPixelSizeInMapUnits(e,()=>this.pixelSizeAt(e))??1}hitTest(e,t){if(!this.ready)return l.getLogger(this).error(`#hitTest()`,`Scene view cannot be used before it is ready`),null;let n=G(e)?K(this,e):e;return at(this,n,t,this._defaultHitTestOptions)}async popupHitTest(e){return ot(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async zoomIn(){if(this.canZoomIn)return this.navigation.zoom(!0)}async zoomOut(){if(this.canZoomOut)return this.navigation.zoom(!1)}async whenAnalysisView(e){if(e.parent==null)throw new a(`view:no-analysisview-for-analysis`,`The analysis does not exist in view.analyses`,{analysis:e});switch(e.parent.type){case`line-of-sight`:case`dimension`:case`viewshed`:return(await this.whenLayerView(e.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(e)}}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){let t=await this._completeSettings(e);await this.whenReady();let n=(await this.stage.renderView.takeScreenshot(t))[0];return(await import(`./support/screenshotUtils.js`)).encode(n,t,this._pixelFormat())}async _takeScreenshot(e){let t=await this._completeSettings(e);await this.whenReady();let n=(await this.stage.renderView.takeScreenshot(t))[0];return(await import(`./support/screenshotUtils.js`)).encodeData(n,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){let t=await this._completeSettings(e);t.olidColor=!0,await this.whenReady();let n=await this.stage.renderView.takeScreenshot(t),{encodeData:r}=await import(`./support/screenshotUtils.js`);return[r(n[0],this._pixelFormat()),r(n[1],this._pixelFormat())]}async _completeSettings(e){let{toRenderSettings:t,screenshotSuperSampleSettings:n}=await import(`./support/screenshotUtils.js`),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,n(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!yt())throw new a(`360vr:objectAndLayerId-rendering-disabled`,`has enable-feature:objectAndLayerId-rendering must be true`);let{encode:t}=await import(`./support/screenshotUtils.js`),n=await this._completeSettings(e);n.olidColor=!0,await this.whenReady();let r=await this.stage.renderView.takeScreenshot(n),i=t(r[0],n,this._pixelFormat()),o=await this._completeSettings(e);return o.format=`png`,[i,t(r[1],o,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){let e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new a(`360vr:objectAndLayerId-rendering-disabled`,`has enable-feature:objectAndLayerId-rendering must be true`)}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}getAttributionItems(){return super.getAttributionItems().concat(this.attribution3D.attributionItems)}importLayerView(e){return N.importLayerView(e)}hasLayerViewModule(e){return N.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getWebDocumentSpatialReference(){return this.scene?.initialViewProperties?.spatialReference}getDefaultTimeZone(){return this.scene?.initialViewProperties?.timeZone??null}getSurface(){return this.surface}get _predeterminedViewingMode(){let e=this._isOverridden(`viewingMode`)?this._get(`viewingMode`):this.scene?.initialViewProperties?.viewingMode;return e==null?null:M(e)}getSpatialReferenceSupport(e,t){let n=this._predeterminedViewingMode,r=r=>this._validateSpatialReferenceForViewingMode(e,t,r)?this._makeSpatialReferenceConstraints(e,t,r,n):null,i=n?r(n):[...r(1)??[],...r(2)??[]];return i?.length?{constraints:i}:null}_validateSpatialReferenceForViewingMode(e,t,n){return Et(e,n)?t==null||E(t)?!0:!(D(t)&&mt(t,e,n)==null||O(t)&&n===1):!1}_makeSpatialReferenceConstraints(e,t,n,r){if(t==null)return[{spatialReference:e,viewingMode:n}];let{isWebMercator:i,isWGS84:a,vcsWkid:o,latestVcsWkid:s}=e,c=()=>o==null?i?w.WGS84:w.WebMercator:new w({...i?Oe:ke,vcsWkid:o,latestVcsWkid:s});return E(t)&&(i||a)?!(a&&r!==2)||ht(t.tileInfo,t.fullExtent,e,1)===null?[{spatialReference:e,viewingMode:n},{spatialReference:c(),viewingMode:n}]:[{spatialReference:c(),viewingMode:n}]:!D(t)&&!O(t)&&(i||a)?[{spatialReference:e,viewingMode:n},{spatialReference:c(),viewingMode:n}]:D(t)&&i&&n!==1?[{spatialReference:e,viewingMode:n},{spatialReference:c(),viewingMode:2}]:[{spatialReference:e,viewingMode:n}]}_validateSpatialReference(e){let t=this.getSpatialReferenceSupport(e)!=null,n=this._predeterminedViewingMode;return t||(n==null?e.isGeographic&&l.getLogger(this).warnOnce(`Spatial reference is geographic but not supported.`):l.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${j(n)} viewing mode.`)),t}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}trackGraphicState(e){if(!e.graphic)return l.getLogger(this).error(`trackGraphicState`,`GraphicState.graphic must not be null or undefined to start tracking`),null;let t=this.getViewForGraphic(e.graphic),n=null,r=!1,i=t=>{!r&&t!=null&&`processor`in t&&t.processor?.type===`graphics-3d`&&t.processor.graphicsCore&&(n=t.processor.graphicsCore.trackGraphicState(e))};return t==null?this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then(e=>i(e),()=>{}).catch(()=>{}):i(t),c(()=>{r=!0,n!=null&&(n.remove(),n=null)})}maskOccludee(e){if(!e)return l.getLogger(this).error(`maskOccludee`,`GraphicState.graphic must not be null or undefined to mask an occludee`),null;let t=this.getViewForGraphic(e),n=null,r=!1,i=t=>{!r&&t!=null&&Tt(t)&&(n=t.maskOccludee(e))};return t==null?this.whenViewForGraphic(e,{waitForLayer:!0}).then(e=>i(e),()=>{}).catch(()=>{}):i(t),c(()=>{r=!0,n!=null&&(n.remove(),n=null)})}getViewForGraphic(e){return e.layer===this?this.graphicsView:e.layer?this.allLayerViews.filter(e=>e.type!==`media-3d`).find(t=>t.layer===e.layer):null}graphicChanged(e){this.graphicsView!=null&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await ae(()=>this.graphicsView),this.graphicsView):!e.layer||!this.map?null:!t||!t.waitForLayer||this.map.allLayers.includes(e.layer)?this.whenLayerView(e.layer):new Promise((t,n)=>{let r=this.map.allLayers.on(`change`,i=>{i.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,n))})})}enableFeatureTiles(){let e=Symbol();return this._featureTileTreeClients.add(e),c(()=>this._featureTileTreeClients.delete(e))}async _importModule(e,t){let n=new AbortController;this._importControllers.set(e,n),this._updatingChanged();try{let r=await It[e]();if(t&&(ne(this),d(n.signal),await t(n.signal)),this.destroyed)throw re();return d(n.signal),r}catch{return null}finally{this._importControllers.delete(e),this._updatingChanged()}}_abortImport(e){this._importControllers.get(e)?.abort(),this._importControllers.delete(e),this._updatingChanged()}_initBasemapTerrain(){this._set(`basemapTerrain`,new V({view:this})),this.elevationProvider.register(0,this.basemapTerrain)}_exitBasemapTerrain(){let{basemapTerrain:e,elevationProvider:t}=this;e&&(this._set(`basemapTerrain`,null),t.unregister(e),e.destroy())}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set(`pointsOfInterest`,new B({view:this})),this.addHandles([this.updatingHandles.add(()=>L.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import(`./3d/layers/support/FeatureTileTree3DDebugger.js`)).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&L.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||(this._featureTreeDebugger=u(this._featureTreeDebugger))},g),this.updatingHandles.add(()=>({basemapExtent:this.groundView?.groundExtent,basemapSpatialReference:this.groundView?.spatialReference,clippingArea:this.clippingArea,featureTiles:this._featureTiles}),({basemapExtent:e,basemapSpatialReference:t,clippingArea:n,featureTiles:r})=>{if(!r)return;let i=!!e;if(!n&&!i)r.filterExtent=null;else if(!i||!t)r.filterExtent=n;else{let i=e&&t?C(we(e,t),this.spatialReference):null;r.filterExtent=n?n.intersection(i):i}},g),this.updatingHandles.add(()=>this._featureTileTreeClients.size>0,e=>{e?this.updatingHandles.consumePromise(this._ensureFeatureTileTree()):this._featureTiles=u(this._featureTiles)},h)],Nt),this.stateManager.init()}async _ensureFeatureTileTree(){if(this._featureTiles||this._importControllers.has(`FeatureTileTree3D`))return;let e=(await this.updatingHandles.addPromise(this._importModule(`FeatureTileTree3D`)))?.FeatureTileTree3D;e&&(this._featureTiles=new e({renderCoordsHelper:this.renderCoordsHelper,pointsOfInterest:this.pointsOfInterest,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}),this._updatingChanged())}_exitTerrain(){this.stateManager.exit(),this.removeHandles(J),this.removeHandles(Nt),this._featureTiles=u(this.featureTiles),this._set(`pointsOfInterest`,u(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem()}_initCoordinateSystem(){if(this.spatialReference){let e=this.spatialReference,t=this.state.isGlobal,n=Ee(t,e);n!==this.renderSpatialReference&&(this._set(`renderCoordsHelper`,ct.create(this.state.viewingMode,n)),t||this.addHandles(p(()=>this.groundView?.groundExtent,e=>{let t=this.renderCoordsHelper.spatialReference;e!=null&&(e[0]!==0||e[1]!==0||e[2]!==0||e[3]!==0)&&Ce(e,this.groundView.spatialReference,$,t)&&(this.renderCoordsHelper.extent=$)},h),J),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(H/this.renderCoordsHelper.unitInMeters))}else this._set(`renderCoordsHelper`,null)}_exitCoordinateSystem(){this.removeHandles(J),this._set(`renderCoordsHelper`,null)}_updatingChanged(){this.notifyChange(`updating`)}_updateUpdatingMonitors(e=null){(e==null||e.type!==4)&&(this.removeHandles(`updatingMonitors`),this.allLayerViews.forEach(e=>{e.destroyed||(this.addHandles(p(()=>[e.updating,e.updatingProgress],()=>this._updatingChanged(),h),`updatingMonitors`),e.when(()=>this._updatingChanged(),()=>this._updatingChanged()))}),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,n){if(!this.overlay||!this.overlay.hasVisibleItems)return n;let r=e.getContext(`2d`,{willReadFrequently:!0});return r.putImageData(n,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,n.width,n.height)}_initStage(){let e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,n)=>this._renderScreenshotOverlay(e,t,n)}},t=new Qe(this.state.viewingMode,e=>this.stage.layers.forEach(e),this);this._set(`sceneIntersectionHelper`,t);let n=i(this.surface);this._stage=new vt({view:this,options:e,container:n}),this.notifyChange(`stage`),this._updateSlice(),this.addHandles([this.on(`pointer-move`,()=>this.stage?.renderer.resetAnimation()),o(this.stage.renderView.canvas,`webglcontextlost`,e=>{this.fatalError=new a(`webgl-context-lost`,e.statusMessage||`WebGL context lost`)})],`stage`),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(H/this.renderCoordsHelper.unitInMeters),this._set(`canvas`,this.stage.renderView.canvas)}_exitStage(){this.sceneIntersectionHelper?.destroy(),this._set(`sceneIntersectionHelper`,null),this._stage=u(this.stage),this._set(`stage`,null),this.removeHandles(`stage`),this._set(`canvas`,null)}_initSurface(){this._exitSurface(),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new dt({view:this,resourceController:this._resourceController})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitTerrain(),this._exitStage())}async _ensureGraphicsView(){if(this.graphicsView||this._importControllers.has(`GraphicsView3D`)||this.graphics.length===0)return;this.removeHandles(`GraphicsView3D`);let e=(await this.updatingHandles.addPromise(this._importModule(`GraphicsView3D`,e=>ae(()=>this.groundView?.ready,e))))?.default;e&&this._set(`graphicsView`,new e({view:this,getGraphics:()=>this.graphics})),this._updatingChanged()}_disposeGraphicsView(){this._abortImport(`GraphicsView3D`),this.removeHandles(`GraphicsView3D`),this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set(`graphicsView`,null))}_disposeFocusAreasView(){this._abortImport(`FocusAreasView`),this.removeHandles(`FocusAreasView`),this.focusAreasView=u(this.focusAreasView)}async _ensureFocusAreasView(e){if(this.focusAreasView||this._importControllers.has(`FocusAreasView`)||e===0)return;this.removeHandles(`FocusAreasView`);let t=(await this.updatingHandles.addPromise(this._importModule(`FocusAreasView`)))?.FocusAreasView;t&&(this.focusAreasView=new t({view:this})),this._updatingChanged()}_startup(){M(this.viewingMode)===1&&(this._clippingArea=null),this._initSurface(),this._set(`ready`,!0),this.addHandles(f(()=>this.graphics,`after-changes`,()=>this._ensureGraphicsView()),`GraphicsView3D`),this._ensureGraphicsView(),this.addHandles(this.updatingHandles.add(()=>this.map?.focusAreas?.areas.length??0,e=>this._ensureFocusAreasView(e),{initial:!0}),`FocusAreasView`);let e=this.scene?.initialViewProperties??null,t=e?.environment;t&&(this._overrideDefaultEnvironmentOnly?me(this.environment,t):this.environment=this.environment.cloneWithWebsceneEnvironment(t)),this.timeExtent=e?.timeExtent,e?.analyses.applyTo(this),this.labeler.setup(),this.environmentView.connectView(this),this.inputManager.connect();let n=this._resolveWhenReady;this._resolveWhenReady=[],n.forEach(e=>e(this))}_teardown(){this.inputManager.disconnect(),this.environmentView.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this._exitSurface(),this._set(`ready`,!1)}get _defaultToMapOptions(){let e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(U);for(let t of this.allLayerViews)(k(t.layer)&&(!has(`enable-feature:im-as-ground`)||t.layer.isUsedAsGroundLayer)||je(t.layer))&&e.include.add(t.uid);return e}get _defaultHitTestOptions(){let e={exclude:new Set};if(!this.map)return e;this.map.ground&&this.map.ground.opacity<1&&e.exclude.add(U);for(let t of this.allLayerViews)(has(`enable-feature:im-as-ground`)?k(t.layer)&&t.layer.isUsedAsGroundLayer:k(t.layer))&&t.fullOpacity<1&&e.exclude.add(t.uid);return e}static{this.type=`3d`}static clearStatics(){Mt(),ge(),ue(),St(),Xe(),Ve(),Se(),wt(),Ne(),_t(),xt(),Ze(),$e(),ve(),se(),bt(),gt(),Ke.cleanupI3SLodHandling(),Me.cleanupTilemapCache(),I.cleanupViewstate(),V.cleanupTerrainSurface()}};e([_({nonNullable:!0}),v(Pt)],Y.prototype,`options`,void 0),e([_()],Y.prototype,`_userClippingArea`,void 0),e([_()],Y.prototype,`_resourceController`,void 0),e([_()],Y.prototype,`stage`,null),e([_({readOnly:!0})],Y.prototype,`deconflictor`,void 0),e([_({readOnly:!0})],Y.prototype,`labeler`,void 0),e([_()],Y.prototype,`navigation`,void 0),e([_({type:Re,readOnly:!0})],Y.prototype,`animation`,null),e([_({readOnly:!0})],Y.prototype,`basemapTerrain`,void 0),e([_({readOnly:!0})],Y.prototype,`overlayManager`,null),e([_({readOnly:!0})],Y.prototype,`elevationProvider`,void 0),e([_()],Y.prototype,`camera`,null),e([_({type:t})],Y.prototype,`contentCamera`,null),e([_({readOnly:!0})],Y.prototype,`canvas`,null),e([_({type:S,useTypeForAutocast:!1})],Y.prototype,`center`,null),e([_({type:x})],Y.prototype,`clippingArea`,null),e([_({type:P,nonNullable:!0})],Y.prototype,`constraints`,void 0),e([_({type:x,readOnly:!0})],Y.prototype,`renderDataExtent`,null),e([_({readOnly:!0})],Y.prototype,`tileInfo`,null),e([_({type:x,readOnly:!0})],Y.prototype,`dataExtent`,null),e([_({type:x,readOnly:!0})],Y.prototype,`_groundAndLayersExtent`,null),e([_({type:F})],Y.prototype,`environment`,null),e([v(`environment`)],Y.prototype,`castEnvironment`,null),e([_({readOnly:!0})],Y.prototype,`environmentView`,void 0),e([_({type:x})],Y.prototype,`extent`,null),e([_({type:r})],Y.prototype,`floors`,void 0),e([_()],Y.prototype,`screenCenter`,null),e([_()],Y.prototype,`frustum`,null),e([_({type:Number,readOnly:!0})],Y.prototype,`fullOpacity`,void 0),e([_({readOnly:!0})],Y.prototype,`graphicsView`,void 0),e([_()],Y.prototype,`analysisViewManager`,void 0),e([_()],Y.prototype,`groundView`,void 0),e([_({readOnly:!0})],Y.prototype,`layerviewCollections`,null),e([_({type:Boolean})],Y.prototype,`initialExtentRequired`,null),e([_()],Y.prototype,`defaultsFromMapSettings`,null),e([_()],Y.prototype,`interacting`,null),e([_()],Y.prototype,`stationary`,null),e([_()],Y.prototype,`navigating`,null),e([_()],Y.prototype,`map`,void 0),e([_()],Y.prototype,`padding`,null),e([_({type:B,readOnly:!0})],Y.prototype,`pointsOfInterest`,void 0),e([_()],Y.prototype,`_featureTiles`,void 0),e([_()],Y.prototype,`featureTiles`,null),e([_()],Y.prototype,`_featureTreeDebugger`,void 0),e([_({constructOnly:!0})],Y.prototype,`deactivatedWebGLExtensions`,void 0),e([_({constructOnly:!0})],Y.prototype,`debugWebGLExtensions`,void 0),e([_({constructOnly:!0})],Y.prototype,`renderCanvas`,void 0),e([_({constructOnly:!0})],Y.prototype,`state`,void 0),e([_()],Y.prototype,`screenSizePerspective`,void 0),e([_({readOnly:!0})],Y.prototype,`inputManager`,void 0),e([_({readOnly:!0})],Y.prototype,`stateManager`,void 0),e([_({type:[`low`,`medium`,`high`]})],Y.prototype,`qualityProfile`,null),e([_({type:z,get(){let e=this._get(`qualitySettings`);if(!e){let t=R(this.qualityProfile);e=new z(t)}return e}})],Y.prototype,`qualitySettings`,void 0),e([_()],Y.prototype,`slice`,void 0),e([_({readOnly:!0})],Y.prototype,`typeSpecificPreconditionsReady`,null),e([_({readOnly:!0})],Y.prototype,`renderCoordsHelper`,void 0),e([_({readOnly:!0})],Y.prototype,`sceneIntersectionHelper`,void 0),e([_({type:Number,readOnly:!0})],Y.prototype,`resolution`,null),e([_({type:Number})],Y.prototype,`scale`,null),e([_({readOnly:!0,type:Number})],Y.prototype,`terrainLevel`,null),e([_()],Y.prototype,`heightModelInfo`,null),e([_({type:w})],Y.prototype,`spatialReference`,void 0),e([_({type:Boolean,value:!1})],Y.prototype,`alphaCompositingEnabled`,null),e([_({constructOnly:!0})],Y.prototype,`preserveDrawingBufferEnabled`,void 0),e([_({type:Boolean})],Y.prototype,`supersampleScreenshotsEnabled`,void 0),e([_({readOnly:!0})],Y.prototype,`type`,void 0),e([_(),v(e=>e instanceof kt?e:b(At,e))],Y.prototype,`ui`,void 0),e([_({type:Boolean,readOnly:!0})],Y.prototype,`updating`,null),e([_()],Y.prototype,`_updatingObjects`,null),e([_()],Y.prototype,`_updatingObjectsWithProgress`,null),e([_()],Y.prototype,`_updatingObjectsToDebug`,null),e([_({type:Number,readOnly:!0})],Y.prototype,`updatingProgress`,void 0),e([_({type:[`global`,`local`]})],Y.prototype,`viewingMode`,null),e([_({type:n})],Y.prototype,`viewpoint`,null),e([_({readOnly:!0})],Y.prototype,`visibleArea`,null),e([_({type:Number})],Y.prototype,`zoom`,null),e([_({readOnly:!0})],Y.prototype,`quality`,null),e([_({readOnly:!0})],Y.prototype,`resolutionScale`,null),e([_()],Y.prototype,`focusAreasView`,void 0),e([_()],Y.prototype,`_defaultToMapOptions`,null),e([_()],Y.prototype,`_defaultHitTestOptions`,null),Y=q=e([pe(`esri.views.SceneView`)],Y);function X(e,t){return e!=null&&xe(e.spatialReference,t)?C(e,t):null}const Z=_e(),Q=le(),$=Te(),Ft=Ae(0,0,0,w.WebMercator),It={GraphicsView3D:()=>import(`./3d/layers/GraphicsView3D.js`),FocusAreasView:()=>import(`./3d/FocusAreasView.js`),FeatureTileTree3D:()=>import(`./3d/layers/support/FeatureTileTree3D.js`)},Lt=Y;export{Lt as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import has from"../../../core/has.js";import n from"../../../core/Logger.js";import{watch as r,syncAndInitial as i}from"../../../core/reactiveUtils.js";import{sqlAnd as a}from"../../../core/sql.js";import{property as o,subclass as s}from"../../../core/accessorSupport/decorators.js";import c from"../../../layers/support/FeatureFilter.js";import{getFloorFilterClause as l}from"../../../layers/support/floorFilterUtils.js";import{isSubtypeGroupLayer as u,isFeatureLayer as d}from"../../../layers/support/layerUtils.js";import{isUtilityNetworkWebMap as f}from"./snappingUtils.js";import{scaleBoundsPredicate as p}from"../../support/layerViewUtils.js";let m=class extends t{set attributeRulesEnabled(e){this._set(`attributeRulesEnabled`,e),e&&this.loadRules()}get layerView(){return this.view?.allLayerViews?.find(e=>e.layer===this.layer)}get valid(){let{_valid:e,snappingSource:t,layer:n}=this;return!t||!n?!1:e}get subtypeFilter(){let{layer:e,snappingSource:t}=this;if(!u(e)||!e.subtypes?.length||!t)return{mode:`not-in-use`,filter:null};let n=t.layerSource.sublayerSources.filter(e=>e.enabled&&e.layer.visible&&p(this.view?.scale,e.layer.effectiveScaleRange.minScale,e.layer.effectiveScaleRange.maxScale)).map(e=>e.layer.subtypeCode);if(!n.length)return{mode:`none-visible`,filter:null};if(n.length===e.subtypes.length)return{mode:`all-visible`,filter:null};let r=e.fieldsIndex.get(e.subtypeField)?.name??e.subtypeField;return n.length===1?{mode:`in-use`,filter:`${r} = ${n.getItemAt(0)}`}:{mode:`in-use`,filter:`${r} IN (${n.join(`, `)})`}}get floorFilter(){let{view:e,layer:t}=this;return!e||!t?null:l({view:e,layer:t})}constructor(e){super(e),this.layer=null,this.snappingSource=null,this.rulesTable=null,this._valid=null}initialize(){if(!this.snappingSource||!this.layer){this._valid=!1;return}let{layer:e,snappingSource:t}=this;if(`refresh`in e){let n=e;this.addHandles(n.on(`refresh`,()=>t.refresh()))}this.loadRules(),this.addHandles([r(()=>t.updating,e=>t.layerSource.updating=e,i),r(()=>t.availability,e=>t.layerSource.availability=e,i)])}getFetchCandidatesParameters(e,t,n){if(!this.valid)return[];let{layer:r,layerView:i,floorFilter:o,rulesTable:s,subtypeFilter:l}=this,p={distance:n,mode:this.view?.type??`2d`,point:e,coordinateHelper:t.coordinateHelper,...h(),filter:i&&`filter`in i?i.filter:null};if(o&&(p.filter=g(p.filter,o)),l.mode!==`not-in-use`&&l.mode!==`all-visible`){if(l.mode===`none-visible`)return[];p.filter?p.filter.where=a(p.filter.where,l.mode):p.filter=new c({where:l.filter})}if(!this.attributeRulesEnabled)return[p];let m=t.feature,_=m?.sourceLayer?.type===`subtype-sublayer`?m.sourceLayer.parent:m?.sourceLayer;if(s&&m&&f(this.view?.map)&&(d(r)||u(r))&&(d(_)||u(_))&&this.view.map.utilityNetworks?.find(e=>e.isUtilityLayer(_))){if(s.loadStatus!==`loaded`)return[];let e=[],t=r.layerId,n=s.getFeatureSQL(_,m)?.[t];if(!n)return[];let i=n.anyVertex,a=n.endVertex;return a&&i&&a===i&&(a=``),a&&e.push({...p,returnEdge:!1,vertexMode:`ends`,filter:g(p.filter,a)}),i&&e.push({...p,returnEdge:has(`snapping-include-edges-when-applying-any-vertex-rule`)??!1,vertexMode:`all`,filter:g(p.filter,i)}),e}return[p]}async loadRules(){this._valid=null;let{layer:e,view:t,attributeRulesEnabled:r}=this;if(r&&e&&t&&f(t?.map)&&(d(e)||u(e)))try{await Promise.allSettled(t.map.utilityNetworks?.map(e=>e.load())??[]);let n=t.map.utilityNetworks?.find(t=>t.isUtilityLayer(e));n&&(this.rulesTable=await n.getRulesTable(),await this.rulesTable?.load())}catch{this._valid=!1,n.getLogger(`esri.views.interactive.snapping.FeatureSnappingSourceInfo`).error(`Failed to load rules table for snapping source`,e.title);return}this._valid=!0}remove(){this.destroy()}destroy(){this.snappingSource?.destroy()}};e([o({constructOnly:!0})],m.prototype,`layer`,void 0),e([o({constructOnly:!0})],m.prototype,`snappingSource`,void 0),e([o({constructOnly:!0})],m.prototype,`view`,void 0),e([o({value:!1})],m.prototype,`attributeRulesEnabled`,null),e([o()],m.prototype,`layerView`,null),e([o()],m.prototype,`rulesTable`,void 0),e([o()],m.prototype,`valid`,null),e([o()],m.prototype,`subtypeFilter`,null),e([o()],m.prototype,`floorFilter`,null),e([o()],m.prototype,`_valid`,void 0),m=e([s(`esri.views.interactive.snapping.FeatureSnappingSourceInfo`)],m);function h(){return{returnEdge:!0,vertexMode:`all`}}function g(e,t){return e==null?new c({where:t}):e.where?new c({where:a(e.where,t)}):new c({where:t})}export{m as FeatureSnappingSourceInfo};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import has from"../../../core/has.js";import n from"../../../core/Logger.js";import{watch as r,syncAndInitial as i}from"../../../core/reactiveUtils.js";import{sqlAnd as a}from"../../../core/sql.js";import{property as o,subclass as s}from"../../../core/accessorSupport/decorators.js";import{scaleBoundsPredicate as c}from"../../../geometry/support/scaleUtils.js";import l from"../../../layers/support/FeatureFilter.js";import{getFloorFilterClause as u}from"../../../layers/support/floorFilterUtils.js";import{isSubtypeGroupLayer as d,isFeatureLayer as f}from"../../../layers/support/layerUtils.js";import{isUtilityNetworkWebMap as p}from"./snappingUtils.js";let m=class extends t{set attributeRulesEnabled(e){this._set(`attributeRulesEnabled`,e),e&&this.loadRules()}get layerView(){return this.view?.allLayerViews?.find(e=>e.layer===this.layer)}get valid(){let{_valid:e,snappingSource:t,layer:n}=this;return!t||!n?!1:e}get subtypeFilter(){let{layer:e,snappingSource:t}=this;if(!d(e)||!e.subtypes?.length||!t)return{mode:`not-in-use`,filter:null};let n=t.layerSource.sublayerSources.filter(e=>e.enabled&&e.layer.visible&&c(this.view?.scale,e.layer.effectiveScaleRange.minScale,e.layer.effectiveScaleRange.maxScale)).map(e=>e.layer.subtypeCode);if(!n.length)return{mode:`none-visible`,filter:null};if(n.length===e.subtypes.length)return{mode:`all-visible`,filter:null};let r=e.fieldsIndex.get(e.subtypeField)?.name??e.subtypeField;return n.length===1?{mode:`in-use`,filter:`${r} = ${n.getItemAt(0)}`}:{mode:`in-use`,filter:`${r} IN (${n.join(`, `)})`}}get floorFilter(){let{view:e,layer:t}=this;return!e||!t?null:u({view:e,layer:t})}constructor(e){super(e),this.layer=null,this.snappingSource=null,this.rulesTable=null,this._valid=null}initialize(){if(!this.snappingSource||!this.layer){this._valid=!1;return}let{layer:e,snappingSource:t}=this;if(`refresh`in e){let n=e;this.addHandles(n.on(`refresh`,()=>t.refresh()))}this.loadRules(),this.addHandles([r(()=>t.updating,e=>t.layerSource.updating=e,i),r(()=>t.availability,e=>t.layerSource.availability=e,i)])}getFetchCandidatesParameters(e,t,n){if(!this.valid)return[];let{layer:r,layerView:i,floorFilter:o,rulesTable:s,subtypeFilter:c}=this,u={distance:n,mode:this.view?.type??`2d`,point:e,coordinateHelper:t.coordinateHelper,...h(),filter:i&&`filter`in i?i.filter:null};if(o&&(u.filter=g(u.filter,o)),c.mode!==`not-in-use`&&c.mode!==`all-visible`){if(c.mode===`none-visible`)return[];u.filter?u.filter.where=a(u.filter.where,c.mode):u.filter=new l({where:c.filter})}if(!this.attributeRulesEnabled)return[u];let m=t.feature,_=m?.sourceLayer?.type===`subtype-sublayer`?m.sourceLayer.parent:m?.sourceLayer;if(s&&m&&p(this.view?.map)&&(f(r)||d(r))&&(f(_)||d(_))&&this.view.map.utilityNetworks?.find(e=>e.isUtilityLayer(_))){if(s.loadStatus!==`loaded`)return[];let e=[],t=r.layerId,n=s.getFeatureSQL(_,m)?.[t];if(!n)return[];let i=n.anyVertex,a=n.endVertex;return a&&i&&a===i&&(a=``),a&&e.push({...u,returnEdge:!1,vertexMode:`ends`,filter:g(u.filter,a)}),i&&e.push({...u,returnEdge:has(`snapping-include-edges-when-applying-any-vertex-rule`)??!1,vertexMode:`all`,filter:g(u.filter,i)}),e}return[u]}async loadRules(){this._valid=null;let{layer:e,view:t,attributeRulesEnabled:r}=this;if(r&&e&&t&&p(t?.map)&&(f(e)||d(e)))try{await Promise.allSettled(t.map.utilityNetworks?.map(e=>e.load())??[]);let n=t.map.utilityNetworks?.find(t=>t.isUtilityLayer(e));n&&(this.rulesTable=await n.getRulesTable(),await this.rulesTable?.load())}catch{this._valid=!1,n.getLogger(`esri.views.interactive.snapping.FeatureSnappingSourceInfo`).error(`Failed to load rules table for snapping source`,e.title);return}this._valid=!0}remove(){this.destroy()}destroy(){this.snappingSource?.destroy()}};e([o({constructOnly:!0})],m.prototype,`layer`,void 0),e([o({constructOnly:!0})],m.prototype,`snappingSource`,void 0),e([o({constructOnly:!0})],m.prototype,`view`,void 0),e([o({value:!1})],m.prototype,`attributeRulesEnabled`,null),e([o()],m.prototype,`layerView`,null),e([o()],m.prototype,`rulesTable`,void 0),e([o()],m.prototype,`valid`,null),e([o()],m.prototype,`subtypeFilter`,null),e([o()],m.prototype,`floorFilter`,null),e([o()],m.prototype,`_valid`,void 0),m=e([s(`esri.views.interactive.snapping.FeatureSnappingSourceInfo`)],m);function h(){return{returnEdge:!0,vertexMode:`all`}}function g(e,t){return e==null?new l({where:t}):e.where?new l({where:a(e.where,t)}):new l({where:t})}export{m as FeatureSnappingSourceInfo};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{equals as t}from"../../core/arrayUtils.js";import{createTask as n}from"../../core/asyncUtils.js";import{EventedAccessor as r}from"../../core/Evented.js";import{IdentifiableMixin as i}from"../../core/Identifiable.js";import a from"../../core/Logger.js";import{destroyMaybe as o,removeMaybe as s}from"../../core/maybe.js";import{EsriPromiseMixin as c}from"../../core/Promise.js";import{throwIfAborted as l}from"../../core/promiseUtils.js";import{property as u,subclass as d}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as f}from"../../core/support/UpdatingHandles.js";import{getAttributionItemFromUserCopyright as p,isDynamicAttributionLayer as m,createAttributionIndex as h,getAttributionItemsFromIndex as g,getAttributionItemFromAccessInformation as _,getAttributionItemFromLayerCopyright as v}from"../support/attributionUtils.js";import{validateScaleRange as y}from"../support/layerViewUtils.js";let b=class extends i(c(r)){get spatialReferenceSupported(){return!0}constructor(e){super(e),this._updatingHandles=new f,this._attributionIndexTask=null,this.layer=null,this.parent=null}initialize(){this.when().catch(e=>{if(e?.name!==`layerview:create-error`){let t=this.layer&&this.layer.id||`no id`,n=this.layer?.title||`no title`;a.getLogger(this).error(`#resolve()`,`Failed to resolve layer view (layer title: '${n}', id: '${t}')`,e)}})}destroy(){this._updatingHandles=o(this._updatingHandles),this._attributionIndexTask=s(this._attributionIndexTask),this._set(`parent`,null)}get attributionItems(){let e=this._get(`attributionItems`)??[];if(this.suspended||!this.layer?.attributionVisible)return e.length===0?e:[];if(!this.view.stationary)return e;let n=this.getAttributionItems();return t(e,n,(e,t)=>e.text===t.text)?e:n}get attributionUpdating(){return this._attributionIndexTask?!this._attributionIndexTask.finished:!1}get fullOpacity(){return(this.layer?.opacity??1)*(this.parent?.fullOpacity??1)}get suspended(){return this.destroyed||!this.canResume()}get suspendInfo(){return this.getSuspendInfo()}get legendEnabled(){return!this.suspended&&this.layer?.legendEnabled===!0}get updating(){return!!(this._updatingHandles?.updating||this.isUpdating())}get updatingProgress(){return+!this.updating}get updateSuspended(){return this.suspended}get visible(){return this.layer?.visible===!0}set visible(e){this._overrideIfSome(`visible`,e)}get visibleAtCurrentScale(){return!0}get visibleAtCurrentTimeExtent(){let e=this.view.timeExtent,t=this.layer?.visibilityTimeExtent;return!e||!t||!e.intersection(t).isEmpty}canResume(){let e=this.layer&&`effectiveScaleRange`in this.layer?this.layer.effectiveScaleRange:null;return this.visible&&this.layer?.loaded&&this.parent&&!this.parent.suspended&&this.view?.ready&&y(e)&&this.visibleAtCurrentScale&&this.visibleAtCurrentTimeExtent||!1}getSuspendInfo(){let e=this.parent?.suspended?this.parent.suspendInfo:{};this.view?.ready||(e.viewNotReady=!0),(!this.layer||!this.layer.loaded)&&(e.layerNotLoaded=!0);let t=this.layer&&`effectiveScaleRange`in this.layer?this.layer.effectiveScaleRange:null;return(!y(t)||!this.visibleAtCurrentScale)&&(e.outsideScaleRange=!0),this.visibleAtCurrentTimeExtent||(e.outsideVisibilityTimeExtent=!0),this.visible||(e.layerInvisible=!0),e}isUpdating(){return!1}getAttributionItems(){let e=p(this.layer);if(e)return[e];if(m(this.layer)&&(this._attributionIndexTask||(this._attributionIndexTask=n(async e=>{let t=await this.layer.fetchAttributionData();return l(e),h(t)}),this._updatingHandles.consumePromise(this._attributionIndexTask.promise)),this._attributionIndexTask?.finished&&this._attributionIndexTask.value))return g(this._attributionIndexTask.value,this.layer.tileInfo,this.view.scale,this.view.extent);let t=_(this.layer);if(t)return[t];let r=v(this.layer);return r?[r]:[]}};e([u({readOnly:!0})],b.prototype,`spatialReferenceSupported`,null),e([u()],b.prototype,`view`,void 0),e([u({readOnly:!0})],b.prototype,`attributionItems`,null),e([u({readOnly:!0})],b.prototype,`attributionUpdating`,null),e([u()],b.prototype,`fullOpacity`,null),e([u()],b.prototype,`layer`,void 0),e([u()],b.prototype,`parent`,void 0),e([u({readOnly:!0})],b.prototype,`suspended`,null),e([u({readOnly:!0})],b.prototype,`suspendInfo`,null),e([u({readOnly:!0})],b.prototype,`legendEnabled`,null),e([u({type:Boolean,readOnly:!0})],b.prototype,`updating`,null),e([u({readOnly:!0})],b.prototype,`updatingProgress`,null),e([u()],b.prototype,`updateSuspended`,null),e([u()],b.prototype,`visible`,null),e([u({readOnly:!0})],b.prototype,`visibleAtCurrentScale`,null),e([u({readOnly:!0})],b.prototype,`visibleAtCurrentTimeExtent`,null),b=e([d(`esri.views.layers.LayerView`)],b);export{b as default};
2
+ import{__decorate as e}from"tslib";import{equals as t}from"../../core/arrayUtils.js";import{createTask as n}from"../../core/asyncUtils.js";import{EventedAccessor as r}from"../../core/Evented.js";import{IdentifiableMixin as i}from"../../core/Identifiable.js";import a from"../../core/Logger.js";import{destroyMaybe as o,removeMaybe as s}from"../../core/maybe.js";import{EsriPromiseMixin as c}from"../../core/Promise.js";import{throwIfAborted as l}from"../../core/promiseUtils.js";import{property as u,subclass as d}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as f}from"../../core/support/UpdatingHandles.js";import{validateScaleRange as p}from"../../geometry/support/scaleUtils.js";import{getAttributionItemFromUserCopyright as m,isDynamicAttributionLayer as h,createAttributionIndex as g,getAttributionItemsFromIndex as _,getAttributionItemFromAccessInformation as v,getAttributionItemFromLayerCopyright as y}from"../support/attributionUtils.js";let b=class extends i(c(r)){get spatialReferenceSupported(){return!0}constructor(e){super(e),this._updatingHandles=new f,this._attributionIndexTask=null,this.layer=null,this.parent=null}initialize(){this.when().catch(e=>{if(e?.name!==`layerview:create-error`){let t=this.layer&&this.layer.id||`no id`,n=this.layer?.title||`no title`;a.getLogger(this).error(`#resolve()`,`Failed to resolve layer view (layer title: '${n}', id: '${t}')`,e)}})}destroy(){this._updatingHandles=o(this._updatingHandles),this._attributionIndexTask=s(this._attributionIndexTask),this._set(`parent`,null)}get attributionItems(){let e=this._get(`attributionItems`)??[];if(this.suspended||!this.layer?.attributionVisible)return e.length===0?e:[];if(!this.view.stationary)return e;let n=this.getAttributionItems();return t(e,n,(e,t)=>e.text===t.text)?e:n}get attributionUpdating(){return this._attributionIndexTask?!this._attributionIndexTask.finished:!1}get fullOpacity(){return(this.layer?.opacity??1)*(this.parent?.fullOpacity??1)}get suspended(){return this.destroyed||!this.canResume()}get suspendInfo(){return this.getSuspendInfo()}get legendEnabled(){return!this.suspended&&this.layer?.legendEnabled===!0}get updating(){return!!(this._updatingHandles?.updating||this.isUpdating())}get updatingProgress(){return+!this.updating}get updateSuspended(){return this.suspended}get visible(){return this.layer?.visible===!0}set visible(e){this._overrideIfSome(`visible`,e)}get visibleAtCurrentScale(){return!0}get visibleAtCurrentTimeExtent(){let e=this.view.timeExtent,t=this.layer?.visibilityTimeExtent;return!e||!t||!e.intersection(t).isEmpty}canResume(){let e=this.layer&&`effectiveScaleRange`in this.layer?this.layer.effectiveScaleRange:null;return this.visible&&this.layer?.loaded&&this.parent&&!this.parent.suspended&&this.view?.ready&&p(e)&&this.visibleAtCurrentScale&&this.visibleAtCurrentTimeExtent||!1}getSuspendInfo(){let e=this.parent?.suspended?this.parent.suspendInfo:{};this.view?.ready||(e.viewNotReady=!0),(!this.layer||!this.layer.loaded)&&(e.layerNotLoaded=!0);let t=this.layer&&`effectiveScaleRange`in this.layer?this.layer.effectiveScaleRange:null;return(!p(t)||!this.visibleAtCurrentScale)&&(e.outsideScaleRange=!0),this.visibleAtCurrentTimeExtent||(e.outsideVisibilityTimeExtent=!0),this.visible||(e.layerInvisible=!0),e}isUpdating(){return!1}getAttributionItems(){let e=m(this.layer);if(e)return[e];if(h(this.layer)&&(this._attributionIndexTask||(this._attributionIndexTask=n(async e=>{let t=await this.layer.fetchAttributionData();return l(e),g(t)}),this._updatingHandles.consumePromise(this._attributionIndexTask.promise)),this._attributionIndexTask?.finished&&this._attributionIndexTask.value))return _(this._attributionIndexTask.value,this.layer.tileInfo,this.view.scale,this.view.extent);let t=v(this.layer);if(t)return[t];let r=y(this.layer);return r?[r]:[]}};e([u({readOnly:!0})],b.prototype,`spatialReferenceSupported`,null),e([u()],b.prototype,`view`,void 0),e([u({readOnly:!0})],b.prototype,`attributionItems`,null),e([u({readOnly:!0})],b.prototype,`attributionUpdating`,null),e([u()],b.prototype,`fullOpacity`,null),e([u()],b.prototype,`layer`,void 0),e([u()],b.prototype,`parent`,void 0),e([u({readOnly:!0})],b.prototype,`suspended`,null),e([u({readOnly:!0})],b.prototype,`suspendInfo`,null),e([u({readOnly:!0})],b.prototype,`legendEnabled`,null),e([u({type:Boolean,readOnly:!0})],b.prototype,`updating`,null),e([u({readOnly:!0})],b.prototype,`updatingProgress`,null),e([u()],b.prototype,`updateSuspended`,null),e([u()],b.prototype,`visible`,null),e([u({readOnly:!0})],b.prototype,`visibleAtCurrentScale`,null),e([u({readOnly:!0})],b.prototype,`visibleAtCurrentTimeExtent`,null),b=e([d(`esri.views.layers.LayerView`)],b);export{b as default};
@@ -2,8 +2,7 @@ import type Collection from "../../core/Collection.js";
2
2
  import type LineOfSightLayer from "../../layers/LineOfSightLayer.js";
3
3
  import type LineOfSightAnalysisResult from "../3d/analysis/LineOfSightAnalysisResult.js";
4
4
  import type LayerView from "./LayerView.js";
5
- import type { AbortOptions } from "../../core/promiseUtils.js";
6
- import type { LineOfSightPlacementResult } from "../3d/analysis/LineOfSight/types.js";
5
+ import type { LineOfSightPlacementOptions, LineOfSightPlacementResult } from "../3d/analysis/LineOfSight/types.js";
7
6
  import type { LayerViewProperties } from "./LayerView.js";
8
7
 
9
8
  export interface LineOfSightLayerViewProperties extends LayerViewProperties, Partial<Pick<LineOfSightLayerView, "interactive">> {}
@@ -86,7 +85,7 @@ export default abstract class LineOfSightLayerView extends LayerView {
86
85
  *
87
86
  * Calling this method sets [interactive](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LineOfSightLayerView/#interactive) to `true`.
88
87
  *
89
- * @param options - An object specifying additional options.
88
+ * @param options - Additional placement options, including elevation information and an abort signal.
90
89
  * @returns A promise
91
90
  * which resolves when the operation is completed successfully - i.e. the user places an observer and/or target(s),
92
91
  * leaving the analysis in a valid state. Otherwise, the promise is rejected.
@@ -105,5 +104,5 @@ export default abstract class LineOfSightLayerView extends LayerView {
105
104
  * // cancel the placement operation at some later point
106
105
  * abortController.abort();
107
106
  */
108
- place(options?: AbortOptions | null | undefined): Promise<LineOfSightPlacementResult>;
107
+ place(options?: LineOfSightPlacementOptions | null | undefined): Promise<LineOfSightPlacementResult>;
109
108
  }
@@ -1,8 +1,7 @@
1
1
  import type Viewshed from "../../analysis/Viewshed.js";
2
2
  import type ViewshedLayer from "../../layers/ViewshedLayer.js";
3
3
  import type LayerView from "./LayerView.js";
4
- import type { AbortOptions } from "../../core/promiseUtils.js";
5
- import type { ViewshedPlacementResult } from "../3d/analysis/Viewshed/types.js";
4
+ import type { ViewshedPlacementOptions, ViewshedPlacementResult } from "../3d/analysis/Viewshed/types.js";
6
5
  import type { LayerViewProperties } from "./LayerView.js";
7
6
 
8
7
  export interface ViewshedLayerViewProperties extends LayerViewProperties, Partial<Pick<ViewshedLayerView, "interactive" | "selectedViewshed">> {}
@@ -68,7 +67,7 @@ export default abstract class ViewshedLayerView extends LayerView {
68
67
  *
69
68
  * Calling this method sets [interactive](https://developers.arcgis.com/javascript/latest/references/core/views/layers/ViewshedLayerView/#interactive) to `true`.
70
69
  *
71
- * @param options - An object specifying additional options.
70
+ * @param options - Additional placement options, including elevation information and an abort signal.
72
71
  * @returns A promise which resolves when creation is completed successfully or rejected if it is
73
72
  * canceled.
74
73
  * @example
@@ -85,7 +84,7 @@ export default abstract class ViewshedLayerView extends LayerView {
85
84
  * // cancel the placement operation at some later point
86
85
  * abortController.abort();
87
86
  */
88
- createViewsheds(options?: AbortOptions | null | undefined): Promise<void>;
87
+ createViewsheds(options?: ViewshedPlacementOptions | null | undefined): Promise<void>;
89
88
  /**
90
89
  * Starts the interactive placement of a single viewshed, adding it to the [layer](https://developers.arcgis.com/javascript/latest/references/core/views/layers/ViewshedLayerView/#layer)'s
91
90
  * [ViewshedLayer.source](https://developers.arcgis.com/javascript/latest/references/core/layers/ViewshedLayer/#source).
@@ -97,7 +96,7 @@ export default abstract class ViewshedLayerView extends LayerView {
97
96
  *
98
97
  * Calling this method sets [interactive](https://developers.arcgis.com/javascript/latest/references/core/views/layers/ViewshedLayerView/#interactive) to `true`.
99
98
  *
100
- * @param options - An object specifying additional options.
99
+ * @param options - Additional placement options, including elevation information and an abort signal.
101
100
  * @returns A promise which
102
101
  * resolves when the operation is completed successfully or rejected if it is canceled.
103
102
  * @since 4.33
@@ -115,5 +114,5 @@ export default abstract class ViewshedLayerView extends LayerView {
115
114
  * // cancel the placement operation at some later point
116
115
  * abortController.abort();
117
116
  */
118
- place(options?: AbortOptions | null | undefined): Promise<ViewshedPlacementResult>;
117
+ place(options?: ViewshedPlacementOptions | null | undefined): Promise<ViewshedPlacementResult>;
119
118
  }
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../core/Error.js";import has from"../../core/has.js";function t(e){return e&&typeof e.highlight==`function`}function n(e){return e&&typeof e.maskOccludee==`function`}function r(e,t,n){return e==null||e>=n&&(t===0||e<=t)}function i(e,t){if(t&&e){let{minScale:n,maxScale:i}=e;if(a(n,i))return r(t,n,i)}return!0}function a(e,t){return e!=null&&e>0||t!=null&&t>0}function o(e){return!e?.minScale||!e.maxScale||e.minScale>=e.maxScale}const s=()=>!has(`disable-feature:layer-based-scale-visibility`);function c(e){return typeof e==`object`&&!!e&&`createQuery`in e&&`queryFeatures`in e&&`layer`in e&&`view`in e}function l(t,n,r){return new e(`layerview:spatial-reference-incompatible`,`The spatial reference of this ${t} (wkid: ${n??`undefined`}) is incompatible with the spatial reference of the view (wkid: ${r??`undefined`}).`,{})}function u(e){return e.type===`integrated-mesh-3d`||e.type===`integrated-mesh-3dtiles`}export{s as hasLayerBasedScaleVisibility,t as highlightsSupported,i as isInEffectiveScaleRange,u as isIntegratedMeshLayerView,a as isScaleRangeActive,c as isSelectableLayerView2D,n as occludeesSupported,r as scaleBoundsPredicate,l as spatialReferenceIncompatibleError,o as validateScaleRange};
2
+ import e from"../../core/Error.js";import has from"../../core/has.js";function t(e){return e&&typeof e.highlight==`function`}function n(e){return e&&typeof e.maskOccludee==`function`}const r=()=>!has(`disable-feature:layer-based-scale-visibility`);function i(e){return typeof e==`object`&&!!e&&`createQuery`in e&&`queryFeatures`in e&&`layer`in e&&`view`in e}function a(t,n,r){return new e(`layerview:spatial-reference-incompatible`,`The spatial reference of this ${t} (wkid: ${n??`undefined`}) is incompatible with the spatial reference of the view (wkid: ${r??`undefined`}).`,{})}function o(e){return e.type===`integrated-mesh-3d`||e.type===`integrated-mesh-3dtiles`}export{r as hasLayerBasedScaleVisibility,t as highlightsSupported,o as isIntegratedMeshLayerView,i as isSelectableLayerView2D,n as occludeesSupported,a as spatialReferenceIncompatibleError};
@@ -5,12 +5,14 @@ import type SketchLabelOptions from "../views/interactive/sketch/SketchLabelOpti
5
5
  import type SketchTooltipOptions from "../views/interactive/sketch/SketchTooltipOptions.js";
6
6
  import type SketchValueOptions from "../views/interactive/sketch/SketchValueOptions.js";
7
7
  import type SnappingOptions from "../views/interactive/snapping/SnappingOptions.js";
8
+ import type SelectionOperation from "../views/selection/SelectionOperation.js";
8
9
  import type Widget from "./Widget.js";
9
10
  import type EditorViewModel from "./Editor/EditorViewModel.js";
10
11
  import type VisibleElements from "./Editor/VisibleElements.js";
11
12
  import type EditorItem from "./Editor/support/EditorItem.js";
12
13
  import type { Icon } from "@esri/calcite-components/components/calcite-icon";
13
14
  import type { MapViewOrSceneView } from "../views/MapViewOrSceneView.js";
15
+ import type { SelectionToolName } from "../views/selection/types.js";
14
16
  import type { WidgetProperties } from "./Widget.js";
15
17
  import type { EditorViewModelEvents, EditorViewModelProperties } from "./Editor/EditorViewModel.js";
16
18
  import type { CancelWorkflowOptions, CreationInfo, EditorStartCreateFeaturesWorkflowAtFeatureEditParameters, EditorStartCreateFeaturesWorkflowAtFeatureTypeSelectionParameters, EditorStartMergeFeaturesWorkflowOptions, EditorStartSplitFeatureWorkflowOptions, FeatureInfo, LayerInfo, SupportingWidgetDefaults } from "./Editor/types.js";
@@ -629,6 +631,14 @@ export default class Editor extends Widget {
629
631
  */
630
632
  get visibleElements(): VisibleElements;
631
633
  set visibleElements(value: VisibleElementsProperties);
634
+ /**
635
+ * Activates a selection tool specified by name. Additionally, cancels the previously active selection operation.
636
+ *
637
+ * @param toolName - The name of the selection tool to activate.
638
+ * @returns A reference to the active selection operation.
639
+ * @since 5.2
640
+ */
641
+ activateSelectionTool(toolName: SelectionToolName): SelectionOperation | undefined;
632
642
  /**
633
643
  * Cancels any active selection operation.
634
644
  *
@@ -18,7 +18,7 @@ export interface FeatureFormProperties extends WidgetProperties, Partial<Pick<Fe
18
18
  *
19
19
  * The [FormTemplate](https://developers.arcgis.com/javascript/latest/references/core/form/FormTemplate/) is used to configure how the form should display and set any associated properties for the form, e.g. title, description, field elements, etc.
20
20
  *
21
- * * > [!NOTE]
21
+ * > [!NOTE]
22
22
  * >
23
23
  * > It is recommended to set the `formTemplate` property on the layer itself so that it can be accessed by other widgets and components that also reference the same layer, such as the [Editor](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-editor/). In addition, it can also be set on the [Editor's `layerInfo`](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-editor/#layerInfos/). If a template is set on the `layerInfo`, it will take precedence over a template set directly on the layer.
24
24
  *
@@ -155,7 +155,7 @@ export default class FeatureForm extends Widget {
155
155
  *
156
156
  * The [FormTemplate](https://developers.arcgis.com/javascript/latest/references/core/form/FormTemplate/) is used to configure how the form should display and set any associated properties for the form, e.g. title, description, field elements, etc.
157
157
  *
158
- * * > [!NOTE]
158
+ * > [!NOTE]
159
159
  * >
160
160
  * > It is recommended to set the `formTemplate` property on the layer itself so that it can be accessed by other widgets and components that also reference the same layer, such as the [Editor](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-editor/). In addition, it can also be set on the [Editor's `layerInfo`](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-editor/#layerInfos/). If a template is set on the `layerInfo`, it will take precedence over a template set directly on the layer.
161
161
  *
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{isSome as n,equals as r}from"../../core/arrayUtils.js";import{createTask as i}from"../../core/asyncUtils.js";import{deprecateUnnecessaryViewModel as a}from"../../core/deprecate.js";import"../../core/has.js";import o from"../../core/Logger.js";import{abortMaybe as s,destroyMaybe as c}from"../../core/maybe.js";import{after as l,throwIfAborted as u}from"../../core/promiseUtils.js";import{watch as d,syncAndInitial as f}from"../../core/reactiveUtils.js";import{createScreenPointArray as p,createRenderScreenPointArray as m}from"../../core/screenUtils.js";import{convertTime as h,offsetDateUTC as g}from"../../core/timeUtils.js";import{property as _,subclass as v}from"../../core/accessorSupport/decorators.js";import{create as y}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{g as b}from"../../chunks/boundedPlane.js";import{longitudeToTimezone as x}from"../../views/3d/support/earthUtils.js";import{computeDirectionsOverTime as S}from"../../views/3d/support/sunUtils.js";import C from"./DiscreteOptions.js";import w from"./DurationOptions.js";import{ShadowTooltipViewModel as T}from"./ShadowTooltipViewModel.js";import E from"./ThresholdOptions.js";import{breadthFirstBinaryPartitioning as D}from"../support/traversalUtils.js";const O=[],k=y(),A=[],j=h(1,`hours`,`milliseconds`);let M=class extends t{constructor(e){super(e),this.view=null,this.tooltip=new T({getDuration:e=>this.getDuration(e)}),this.startTimeOfDay=h(10,`hours`,`milliseconds`),this.endTimeOfDay=h(16,`hours`,`milliseconds`),this.visualizationType=`threshold`,this.thresholdOptions=new E({suppressDeprecationWarning:!0}),this.durationOptions=new w({suppressDeprecationWarning:!0}),this.discreteOptions=new C({suppressDeprecationWarning:!0}),this._running=!0,this._stopPreviewingTask=null,this._updatedRecently=!1,this._autoRestoreForcePreviewEnabled=!0,this._utcOffset=null,e?.suppressDeprecationWarning||a(o.getLogger(this),`Shadow Cast`,`arcgis-shadow-cast`,{version:`5.0`}),this.date=new Date}normalizeCtorArgs(e){let{suppressDeprecationWarning:t,...n}=e??{};return n}initialize(){this.addHandles([d(()=>({view:this.view,tooltipEnabled:this._tooltipEnabled}),({view:e,tooltipEnabled:t})=>{this.tooltip.view=e,this.tooltip.enabled=t},f),d(()=>({dependencies:this._previewDependencies,sceneUpdating:this._sceneUpdating}),()=>{s(this._stopPreviewingTask),this._updatedRecently=!0,this._autoRestoreForcePreviewEnabled&&(this._stopPreviewingTask=i(async e=>{await l(500,e),u(e),this._updatedRecently=!1}))},{sync:!0,initial:!0,equals:(e,t)=>F(e.dependencies,t.dependencies)&&(e.sceneUpdating===t.sceneUpdating||!e.sceneUpdating)}),d(()=>({renderer:this.renderer,parameters:this._visualizationParameters}),e=>N(e.renderer,e.parameters),f),d(()=>({renderer:this.renderer,lightDirections:this._lightDirections,lightDirectionsContext:this._lightDirectionsContext}),e=>N(e.renderer,{lightDirections:e.lightDirections,lightDirectionsContext:e.lightDirectionsContext}),f),d(()=>({renderer:this.renderer,parameters:{enabled:this._running}}),e=>N(e.renderer,e.parameters),f),d(()=>({renderer:this.renderer,parameters:{previewing:this._previewing}}),e=>N(e.renderer,e.parameters),{sync:!0,initial:!0,equals:()=>!1})])}destroy(){this.stop(),N(this.renderer,{enabled:!1}),c(this.tooltip),this._stopPreviewingTask=s(this._stopPreviewingTask)}get state(){return this.view!=null&&this.view.ready&&this._referencePosition!=null?`ready`:`disabled`}set date(e){let t=new Date(e);t.setHours(0,0,0,0),this._set(`date`,t)}get utcOffset(){return this._utcOffset??this._utcOffsetAuto}set utcOffset(e){this._utcOffset=e}get testData(){}get _previewing(){let e=this._updatedRecently,t=this._sceneUpdating;return e||t}get _sceneUpdating(){let{view:e}=this;if(e?.allLayerViews==null)return!0;let{stationary:t,navigating:n,interacting:r,graphicsView:i}=e,a=!t||n||r,o=this._shadowLayerViews?.some(e=>e.updating)??!1,s=!i?.suspended&&!!i?.updating;return a||o||s}get _utcOffsetAuto(){let e=this._referencePosition;return e==null?0:x(e[0],!1)}get _dateUTCOffset(){let e=this.date;return e=g(e,-e.getTimezoneOffset(),`minutes`),e=g(e,-this.utcOffset,`hours`),e}get _startDateTimeUTC(){return g(this._dateUTCOffset,this.startTimeOfDay)}get _endDateTimeUTC(){return g(this._dateUTCOffset,this.endTimeOfDay)}get _referencePosition(){return this.view?.environmentManager?.referencePositionGeographic}get _durationInterval(){return this._duration>0?Math.floor(this._duration/254):255}get _interval(){let e=this._durationInterval;switch(this.visualizationType){case`threshold`:case`duration`:return e;case`discrete`:return this.discreteOptions.interval||e}}get _intervalContext(){let{contextEnabled:e,contextOptions:{interval:t}}=this.thresholdOptions;return this.visualizationType===`threshold`&&e?t||this._durationInterval:-1}get _durationSampleCount(){return this._lightDirections.length}get _duration(){return this.endTimeOfDay-this.startTimeOfDay}get _lightDirections(){return this._calculateLightDirections(this._interval)}get _lightDirectionsContext(){return this._calculateLightDirections(this._intervalContext)}_calculateLightDirections(e){let{view:t}=this;if(t==null||e<=0)return O;let n=t.viewingMode===`global`?k:this._referencePosition;if(n==null)return O;let r=S(this._startDateTimeUTC,this._endDateTimeUTC,e,n,t.state.viewingMode,255),i=r.length;A.length=0;let a=D(0,i,A),o=Array(i);for(let e=0;e<i;++e)o[e]=r[a[e]];return o}get _tooltipEnabled(){return this.state===`ready`&&this.visualizationType!==`discrete`&&this._running&&!this._previewing}get _visualizationParameters(){if(!this._running)return null;switch(this.visualizationType){case`threshold`:return this._thresholdVisualizationParameters;case`duration`:return this._durationVisualizationParameters;case`discrete`:return this._discreteVisualizationParameters}}get _thresholdVisualizationParameters(){let{value:e,color:t}=this.thresholdOptions,n=this._duration;return{visualization:2,thresholdColor:t.toUnitRGBA(),threshold:n>0?e/this._duration:0,...this._thresholdDiscreteVisualizationParameters}}get _thresholdDiscreteVisualizationParameters(){let{contextOptions:{color:e},contextEnabled:t}=this.thresholdOptions,n=e.toUnitRGBA(),r=[n[0],n[1],n[2],0];return t?{visualization:3,gradientColorRamp:[[0,r],[1,n]]}:{}}get _durationVisualizationParameters(){let{color:e,mode:t}=this.durationOptions,n=this._duration,r=n>0&&t===`hourly`?j/n:0,i=e.toUnitRGBA(),a=[i[0],i[1],i[2],0];return r===0?{...this._discreteVisualizationParameters,gradientColorRamp:[[0,a],[1,i]]}:{bandedGradientColorRamp:[[0,a],[1,i]],visualization:1,bandSize:r}}get _discreteVisualizationParameters(){let e=this.discreteOptions.color.toUnitRGBA();return{gradientColorRamp:[[0,[e[0],e[1],e[2],0]],[1,e]],visualization:0}}get _shadowLayerViews(){return this.view?.allLayerViews.items.filter(P)}get _previewDependencies(){let{view:e,_shadowLayerViews:t}=this;if(e==null||t==null)return null;let r=e.slice.plane,i=t,a=i.map(e=>e.layer).filter(n),o=i.map(e=>e.suspended),s=a.map(e=>e.visible),c=a.map(e=>e.opacity),l=!!e.graphicsView?.suspended,u=a.filter(e=>`definitionExpression`in e).map(e=>e.definitionExpression),d=i.filter(e=>`filter`in e).map(e=>e.filter);return{slicePlane:r,startDateUTC:this._startDateTimeUTC,endDateUTC:this._endDateTimeUTC,layerViewSuspended:o,graphicsViewSuspended:l,layerVisibilities:s,layerOpacities:c,filters:d,definitionExpressions:u}}get renderer(){let{view:e}=this;if(e==null)return null;let t=e.stage;return t==null?null:t.renderer}start(){this.setRunning(!0)}stop(){this.setRunning(!1)}setRunning(e){this._running=e}async getDuration(e){let{view:t,renderer:n,_durationSampleCount:r}=this;if(t==null||n==null||r===0)return 0;let i=t.state.camera.screenToRender(p(e.x,e.y),m());return n.readAccumulatedShadow(i)*this._duration}};e([_()],M.prototype,`state`,null),e([_()],M.prototype,`view`,void 0),e([_()],M.prototype,`tooltip`,void 0),e([_({type:Date,nonNullable:!0})],M.prototype,`date`,null),e([_({type:Number,nonNullable:!0})],M.prototype,`utcOffset`,null),e([_({type:Number,nonNullable:!0})],M.prototype,`startTimeOfDay`,void 0),e([_({type:Number,nonNullable:!0})],M.prototype,`endTimeOfDay`,void 0),e([_({type:[`threshold`,`duration`,`discrete`],nonNullable:!0})],M.prototype,`visualizationType`,void 0),e([_({type:E,nonNullable:!0})],M.prototype,`thresholdOptions`,void 0),e([_({type:w,nonNullable:!0})],M.prototype,`durationOptions`,void 0),e([_({type:C,nonNullable:!0})],M.prototype,`discreteOptions`,void 0),e([_()],M.prototype,`_running`,void 0),e([_()],M.prototype,`_stopPreviewingTask`,void 0),e([_()],M.prototype,`_updatedRecently`,void 0),e([_()],M.prototype,`_autoRestoreForcePreviewEnabled`,void 0),e([_()],M.prototype,`_sceneUpdating`,null),e([_()],M.prototype,`_utcOffset`,void 0),e([_()],M.prototype,`_utcOffsetAuto`,null),e([_()],M.prototype,`_dateUTCOffset`,null),e([_()],M.prototype,`_startDateTimeUTC`,null),e([_()],M.prototype,`_endDateTimeUTC`,null),e([_()],M.prototype,`_referencePosition`,null),e([_()],M.prototype,`_interval`,null),e([_()],M.prototype,`_intervalContext`,null),e([_()],M.prototype,`_durationSampleCount`,null),e([_()],M.prototype,`_duration`,null),e([_()],M.prototype,`_lightDirections`,null),e([_()],M.prototype,`_lightDirectionsContext`,null),e([_()],M.prototype,`_tooltipEnabled`,null),e([_()],M.prototype,`_visualizationParameters`,null),e([_()],M.prototype,`_thresholdVisualizationParameters`,null),e([_()],M.prototype,`_thresholdDiscreteVisualizationParameters`,null),e([_()],M.prototype,`_durationVisualizationParameters`,null),e([_()],M.prototype,`_discreteVisualizationParameters`,null),e([_()],M.prototype,`_shadowLayerViews`,null),e([_()],M.prototype,`_previewDependencies`,null),e([_()],M.prototype,`renderer`,null),M=e([v(`esri.widgets.ShadowCast.ShadowCastViewModel`)],M);function N(e,t){e!=null&&t!=null&&e.setParameters({shadowCast:t})}function P(e){if(e.suspended)return!1;switch(e.type){case`building-scene-3d`:case`csv-3d`:case`elevation-3d`:case`feature-3d`:case`geojson-3d`:case`integrated-mesh-3d`:case`integrated-mesh-3dtiles`:case`ogc-feature-3d`:case`route-3d`:case`scene-layer-3d`:case`scene-layer-graphics-3d`:case`stream-3d`:case`wms-3d`:case`catalog-footprint-3d`:return!0;case`base-dynamic-3d`:case`catalog-3d`:case`catalog-dynamic-group-3d`:case`dimension-3d`:case`gaussian-splat-3d`:case`imagery-3d`:case`imagery-tile-3d`:case`line-of-sight-3d`:case`map-image-3d`:case`point-cloud-3d`:case`tile-3d`:case`vector-tile-3d`:case`viewshed-3d`:case`voxel-3d`:case`wfs-3d`:case`wmts-3d`:case`media-3d`:return!1;case`group`:return!1;case`graphics-3d`:return e.layer.graphics.some(e=>{let{symbol:t}=e;return t==null||t.type!==`text`&&!(`symbolLayers`in t)||t.type!==`text`&&t.symbolLayers.some(e=>e.type!==`text`)});default:return!1}}function F(e,t){if(e===t||e==null&&t==null)return!0;if(e==null||t==null)return!1;let n=b(e.slicePlane,t.slicePlane),i=e.startDateUTC.valueOf()===t.startDateUTC.valueOf()&&e.endDateUTC.valueOf()===t.endDateUTC.valueOf(),a=r(e.layerViewSuspended,t.layerViewSuspended)&&e.graphicsViewSuspended===t.graphicsViewSuspended,o=r(e.layerVisibilities,t.layerVisibilities),s=r(e.layerOpacities,t.layerOpacities),c=r(e.filters,t.filters),l=r(e.definitionExpressions,t.definitionExpressions);return n&&i&&a&&o&&s&&c&&l}const I=M;export{I as default};
2
+ import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{isSome as n,equals as r}from"../../core/arrayUtils.js";import{createTask as i}from"../../core/asyncUtils.js";import{deprecateUnnecessaryViewModel as a}from"../../core/deprecate.js";import"../../core/has.js";import o from"../../core/Logger.js";import{abortMaybe as s,destroyMaybe as c}from"../../core/maybe.js";import{after as l,throwIfAborted as u}from"../../core/promiseUtils.js";import{watch as d,syncAndInitial as f}from"../../core/reactiveUtils.js";import{createScreenPointArray as p,createRenderScreenPointArray as m}from"../../core/screenUtils.js";import{convertTime as h,offsetDateUTC as g}from"../../core/timeUtils.js";import{property as _,subclass as v}from"../../core/accessorSupport/decorators.js";import{create as y}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{g as b}from"../../chunks/boundedPlane.js";import{longitudeToTimezone as x}from"../../views/3d/support/earthUtils.js";import{computeDirectionsOverTime as S}from"../../views/3d/support/sunUtils.js";import C from"./DiscreteOptions.js";import w from"./DurationOptions.js";import{ShadowTooltipViewModel as T}from"./ShadowTooltipViewModel.js";import E from"./ThresholdOptions.js";import{breadthFirstBinaryPartitioning as D}from"../support/traversalUtils.js";const O=[],k=y(),A=[],j=h(1,`hours`,`milliseconds`);let M=class extends t{constructor(e){super(e),this.view=null,this.tooltip=new T({getDuration:e=>this.getDuration(e)}),this.startTimeOfDay=h(10,`hours`,`milliseconds`),this.endTimeOfDay=h(16,`hours`,`milliseconds`),this.visualizationType=`threshold`,this.thresholdOptions=new E({suppressDeprecationWarning:!0}),this.durationOptions=new w({suppressDeprecationWarning:!0}),this.discreteOptions=new C({suppressDeprecationWarning:!0}),this._running=!0,this._stopPreviewingTask=null,this._updatedRecently=!1,this._autoRestoreForcePreviewEnabled=!0,this._utcOffset=null,e?.suppressDeprecationWarning||a(o.getLogger(this),`Shadow Cast`,`arcgis-shadow-cast`,{version:`5.0`}),this.date=new Date}normalizeCtorArgs(e){let{suppressDeprecationWarning:t,...n}=e??{};return n}initialize(){this.addHandles([d(()=>({view:this.view,tooltipEnabled:this._tooltipEnabled}),({view:e,tooltipEnabled:t})=>{this.tooltip.view=e,this.tooltip.enabled=t},f),d(()=>({dependencies:this._previewDependencies,sceneUpdating:this._sceneUpdating}),()=>{s(this._stopPreviewingTask),this._updatedRecently=!0,this._autoRestoreForcePreviewEnabled&&(this._stopPreviewingTask=i(async e=>{await l(500,e),u(e),this._updatedRecently=!1}))},{sync:!0,initial:!0,equals:(e,t)=>F(e.dependencies,t.dependencies)&&(e.sceneUpdating===t.sceneUpdating||!e.sceneUpdating)}),d(()=>({renderer:this.renderer,parameters:this._visualizationParameters}),e=>N(e.renderer,e.parameters),f),d(()=>({renderer:this.renderer,lightDirections:this._lightDirections,lightDirectionsContext:this._lightDirectionsContext}),e=>N(e.renderer,{lightDirections:e.lightDirections,lightDirectionsContext:e.lightDirectionsContext}),f),d(()=>({renderer:this.renderer,parameters:{enabled:this._running}}),e=>N(e.renderer,e.parameters),f),d(()=>({renderer:this.renderer,parameters:{previewing:this._previewing}}),e=>N(e.renderer,e.parameters),{sync:!0,initial:!0,equals:()=>!1})])}destroy(){this.stop(),N(this.renderer,{enabled:!1}),c(this.tooltip),this._stopPreviewingTask=s(this._stopPreviewingTask)}get state(){return this.view!=null&&this.view.ready&&this._referencePosition!=null?`ready`:`disabled`}set date(e){let t=new Date(e);t.setHours(0,0,0,0),this._set(`date`,t)}get utcOffset(){return this._utcOffset??this._utcOffsetAuto}set utcOffset(e){this._utcOffset=e}get testData(){}get _previewing(){let e=this._updatedRecently,t=this._sceneUpdating;return e||t}get _sceneUpdating(){let{view:e}=this;if(e?.allLayerViews==null)return!0;let{stationary:t,navigating:n,interacting:r,graphicsView:i}=e,a=!t||n||r,o=this._shadowLayerViews?.some(e=>e.updating)??!1,s=!i?.suspended&&!!i?.updating;return a||o||s}get _utcOffsetAuto(){let e=this._referencePosition;return e==null?0:x(e[0],!1)}get _dateUTCOffset(){let e=this.date;return e=g(e,-e.getTimezoneOffset(),`minutes`),e=g(e,-this.utcOffset,`hours`),e}get _startDateTimeUTC(){return g(this._dateUTCOffset,this.startTimeOfDay)}get _endDateTimeUTC(){return g(this._dateUTCOffset,this.endTimeOfDay)}get _referencePosition(){return this.view?.environmentView?.referencePositionGeographic}get _durationInterval(){return this._duration>0?Math.floor(this._duration/254):255}get _interval(){let e=this._durationInterval;switch(this.visualizationType){case`threshold`:case`duration`:return e;case`discrete`:return this.discreteOptions.interval||e}}get _intervalContext(){let{contextEnabled:e,contextOptions:{interval:t}}=this.thresholdOptions;return this.visualizationType===`threshold`&&e?t||this._durationInterval:-1}get _durationSampleCount(){return this._lightDirections.length}get _duration(){return this.endTimeOfDay-this.startTimeOfDay}get _lightDirections(){return this._calculateLightDirections(this._interval)}get _lightDirectionsContext(){return this._calculateLightDirections(this._intervalContext)}_calculateLightDirections(e){let{view:t}=this;if(t==null||e<=0)return O;let n=t.viewingMode===`global`?k:this._referencePosition;if(n==null)return O;let r=S(this._startDateTimeUTC,this._endDateTimeUTC,e,n,t.state.viewingMode,255),i=r.length;A.length=0;let a=D(0,i,A),o=Array(i);for(let e=0;e<i;++e)o[e]=r[a[e]];return o}get _tooltipEnabled(){return this.state===`ready`&&this.visualizationType!==`discrete`&&this._running&&!this._previewing}get _visualizationParameters(){if(!this._running)return null;switch(this.visualizationType){case`threshold`:return this._thresholdVisualizationParameters;case`duration`:return this._durationVisualizationParameters;case`discrete`:return this._discreteVisualizationParameters}}get _thresholdVisualizationParameters(){let{value:e,color:t}=this.thresholdOptions,n=this._duration;return{visualization:2,thresholdColor:t.toUnitRGBA(),threshold:n>0?e/this._duration:0,...this._thresholdDiscreteVisualizationParameters}}get _thresholdDiscreteVisualizationParameters(){let{contextOptions:{color:e},contextEnabled:t}=this.thresholdOptions,n=e.toUnitRGBA(),r=[n[0],n[1],n[2],0];return t?{visualization:3,gradientColorRamp:[[0,r],[1,n]]}:{}}get _durationVisualizationParameters(){let{color:e,mode:t}=this.durationOptions,n=this._duration,r=n>0&&t===`hourly`?j/n:0,i=e.toUnitRGBA(),a=[i[0],i[1],i[2],0];return r===0?{...this._discreteVisualizationParameters,gradientColorRamp:[[0,a],[1,i]]}:{bandedGradientColorRamp:[[0,a],[1,i]],visualization:1,bandSize:r}}get _discreteVisualizationParameters(){let e=this.discreteOptions.color.toUnitRGBA();return{gradientColorRamp:[[0,[e[0],e[1],e[2],0]],[1,e]],visualization:0}}get _shadowLayerViews(){return this.view?.allLayerViews.items.filter(P)}get _previewDependencies(){let{view:e,_shadowLayerViews:t}=this;if(e==null||t==null)return null;let r=e.slice.plane,i=t,a=i.map(e=>e.layer).filter(n),o=i.map(e=>e.suspended),s=a.map(e=>e.visible),c=a.map(e=>e.opacity),l=!!e.graphicsView?.suspended,u=a.filter(e=>`definitionExpression`in e).map(e=>e.definitionExpression),d=i.filter(e=>`filter`in e).map(e=>e.filter);return{slicePlane:r,startDateUTC:this._startDateTimeUTC,endDateUTC:this._endDateTimeUTC,layerViewSuspended:o,graphicsViewSuspended:l,layerVisibilities:s,layerOpacities:c,filters:d,definitionExpressions:u}}get renderer(){let{view:e}=this;if(e==null)return null;let t=e.stage;return t==null?null:t.renderer}start(){this.setRunning(!0)}stop(){this.setRunning(!1)}setRunning(e){this._running=e}async getDuration(e){let{view:t,renderer:n,_durationSampleCount:r}=this;if(t==null||n==null||r===0)return 0;let i=t.state.camera.screenToRender(p(e.x,e.y),m());return n.readAccumulatedShadow(i)*this._duration}};e([_()],M.prototype,`state`,null),e([_()],M.prototype,`view`,void 0),e([_()],M.prototype,`tooltip`,void 0),e([_({type:Date,nonNullable:!0})],M.prototype,`date`,null),e([_({type:Number,nonNullable:!0})],M.prototype,`utcOffset`,null),e([_({type:Number,nonNullable:!0})],M.prototype,`startTimeOfDay`,void 0),e([_({type:Number,nonNullable:!0})],M.prototype,`endTimeOfDay`,void 0),e([_({type:[`threshold`,`duration`,`discrete`],nonNullable:!0})],M.prototype,`visualizationType`,void 0),e([_({type:E,nonNullable:!0})],M.prototype,`thresholdOptions`,void 0),e([_({type:w,nonNullable:!0})],M.prototype,`durationOptions`,void 0),e([_({type:C,nonNullable:!0})],M.prototype,`discreteOptions`,void 0),e([_()],M.prototype,`_running`,void 0),e([_()],M.prototype,`_stopPreviewingTask`,void 0),e([_()],M.prototype,`_updatedRecently`,void 0),e([_()],M.prototype,`_autoRestoreForcePreviewEnabled`,void 0),e([_()],M.prototype,`_sceneUpdating`,null),e([_()],M.prototype,`_utcOffset`,void 0),e([_()],M.prototype,`_utcOffsetAuto`,null),e([_()],M.prototype,`_dateUTCOffset`,null),e([_()],M.prototype,`_startDateTimeUTC`,null),e([_()],M.prototype,`_endDateTimeUTC`,null),e([_()],M.prototype,`_referencePosition`,null),e([_()],M.prototype,`_interval`,null),e([_()],M.prototype,`_intervalContext`,null),e([_()],M.prototype,`_durationSampleCount`,null),e([_()],M.prototype,`_duration`,null),e([_()],M.prototype,`_lightDirections`,null),e([_()],M.prototype,`_lightDirectionsContext`,null),e([_()],M.prototype,`_tooltipEnabled`,null),e([_()],M.prototype,`_visualizationParameters`,null),e([_()],M.prototype,`_thresholdVisualizationParameters`,null),e([_()],M.prototype,`_thresholdDiscreteVisualizationParameters`,null),e([_()],M.prototype,`_durationVisualizationParameters`,null),e([_()],M.prototype,`_discreteVisualizationParameters`,null),e([_()],M.prototype,`_shadowLayerViews`,null),e([_()],M.prototype,`_previewDependencies`,null),e([_()],M.prototype,`renderer`,null),M=e([v(`esri.widgets.ShadowCast.ShadowCastViewModel`)],M);function N(e,t){e!=null&&t!=null&&e.setParameters({shadowCast:t})}function P(e){if(e.suspended)return!1;switch(e.type){case`building-scene-3d`:case`csv-3d`:case`elevation-3d`:case`feature-3d`:case`geojson-3d`:case`integrated-mesh-3d`:case`integrated-mesh-3dtiles`:case`ogc-feature-3d`:case`route-3d`:case`scene-layer-3d`:case`scene-layer-graphics-3d`:case`stream-3d`:case`wms-3d`:case`catalog-footprint-3d`:return!0;case`base-dynamic-3d`:case`catalog-3d`:case`catalog-dynamic-group-3d`:case`dimension-3d`:case`gaussian-splat-3d`:case`imagery-3d`:case`imagery-tile-3d`:case`line-of-sight-3d`:case`map-image-3d`:case`point-cloud-3d`:case`tile-3d`:case`vector-tile-3d`:case`viewshed-3d`:case`voxel-3d`:case`wfs-3d`:case`wmts-3d`:case`media-3d`:return!1;case`group`:return!1;case`graphics-3d`:return e.layer.graphics.some(e=>{let{symbol:t}=e;return t==null||t.type!==`text`&&!(`symbolLayers`in t)||t.type!==`text`&&t.symbolLayers.some(e=>e.type!==`text`)});default:return!1}}function F(e,t){if(e===t||e==null&&t==null)return!0;if(e==null||t==null)return!1;let n=b(e.slicePlane,t.slicePlane),i=e.startDateUTC.valueOf()===t.startDateUTC.valueOf()&&e.endDateUTC.valueOf()===t.endDateUTC.valueOf(),a=r(e.layerViewSuspended,t.layerViewSuspended)&&e.graphicsViewSuspended===t.graphicsViewSuspended,o=r(e.layerVisibilities,t.layerVisibilities),s=r(e.layerOpacities,t.layerOpacities),c=r(e.filters,t.filters),l=r(e.definitionExpressions,t.definitionExpressions);return n&&i&&a&&o&&s&&c&&l}const I=M;export{I as default};