@arcgis/core 5.2.0-next.160 → 5.2.0-next.162

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 (152) hide show
  1. package/arcgisGlobal.d.ts +1 -0
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{0a5a9885ee6f5b5f99f0.js → 167b057ad50e6aef54de.js} +1 -1
  4. package/assets/esri/core/workers/chunks/17c6d66b47aa690df0d4.js +1 -0
  5. package/assets/esri/core/workers/chunks/{15bcf7cfe603f2ee1a24.js → 28104681ba161967039f.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{842893e75696428d536f.js → 3b0808ee3c4facfaca3d.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{eebbde81e56d69dc602f.js → 44f90e75c1dc3d726a95.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{77ebacfdf8e57f2e03f1.js → 46c5371c7a627537098c.js} +11 -11
  9. package/assets/esri/core/workers/chunks/5daa9429808ca31279f2.js +1 -0
  10. package/assets/esri/core/workers/chunks/{60737732ce495bbdd0fc.js → 5f4feca26102088ea565.js} +1 -1
  11. package/assets/esri/core/workers/chunks/6da7229433105a69eb3f.js +1 -0
  12. package/assets/esri/core/workers/chunks/83f29a159b8b5197e76a.js +1 -0
  13. package/assets/esri/core/workers/chunks/849879c8aed16315194c.js +1 -0
  14. package/assets/esri/core/workers/chunks/{1d77c8c59b0118c7e77b.js → 85bba551057366cd00ae.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{9401cc22373566e1171e.js → 8a7b02037151767542f1.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{4eae066673484986d4c1.js → 8e4a7027d171fb60e51e.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{32b351b047ce1eb58146.js → 9ce8b9b80da146a5bbf5.js} +1 -1
  18. package/assets/esri/core/workers/chunks/a2fcbc494333376192aa.js +1 -0
  19. package/assets/esri/core/workers/chunks/a6f969851d4278865cc5.js +1 -0
  20. package/assets/esri/core/workers/chunks/{f1df76f098a3cc924832.js → b5df193c93e9c19f9700.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{28b74bc77f7c13080074.js → be97a629e2ae4d13ceb3.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{d33360c4f85203edafff.js → bf4d913e523eae2fda28.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{172cfeb5f415e4662432.js → d7429b58c90e015263ad.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{612104dff305ff062dfa.js → dfc81e66196c402f39b4.js} +2 -2
  25. package/assets/esri/core/workers/chunks/{02f8654852d389583891.js → e04fb83ab2634bc15cc7.js} +1 -1
  26. package/assets/esri/core/workers/chunks/f74ae0eff3f08978e607.js +1 -0
  27. package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +2 -5
  28. package/assets/esri/themes/dark/main.css +1 -1
  29. package/assets/esri/themes/light/main.css +1 -1
  30. package/assets/esri/themes/light/view.css +1 -1
  31. package/chunks/DefaultMaterial.glsl.js +1 -1
  32. package/chunks/RealisticTree.glsl.js +1 -1
  33. package/chunks/RibbonLine.glsl.js +125 -133
  34. package/config.d.ts +62 -34
  35. package/config.js +1 -1
  36. package/core/has.js +1 -1
  37. package/core/mapCollectionUtils.js +1 -1
  38. package/core/workers/Connection.d.ts +58 -89
  39. package/core/workers.d.ts +45 -54
  40. package/geometry/support/Indices.js +1 -1
  41. package/geometry/support/aaBoundingRect.js +1 -1
  42. package/geometry/support/ray.js +1 -1
  43. package/kernel.js +1 -1
  44. package/layers/FeatureLayer.d.ts +7 -5
  45. package/layers/FeatureLayer.js +1 -1
  46. package/layers/GeospatialPDFLayer.js +1 -1
  47. package/layers/MapImageLayer.d.ts +9 -3
  48. package/layers/MapNotesLayer.d.ts +2 -2
  49. package/layers/SubtypeGroupLayer.d.ts +1 -1
  50. package/layers/SubtypeGroupLayer.js +1 -1
  51. package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +1 -1
  52. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  53. package/layers/graphics/sources/support/QueryTask.js +1 -1
  54. package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +16 -16
  55. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  56. package/layers/mixins/ArcGISMapService.js +1 -1
  57. package/layers/ogc/ogcFeatureUtils.js +1 -1
  58. package/layers/support/Sublayer.d.ts +29 -15
  59. package/layers/support/Sublayer.js +1 -1
  60. package/layers/support/commonProperties.js +1 -1
  61. package/package.json +2 -2
  62. package/rest/layerSources/DynamicDataLayer.d.ts +4 -2
  63. package/rest/layerSources/DynamicDataLayer.js +1 -1
  64. package/rest/layerSources/DynamicMapLayer.d.ts +1 -1
  65. package/rest/layerSources/DynamicWorkspaceLayer.d.ts +45 -0
  66. package/rest/layerSources/DynamicWorkspaceLayer.js +2 -0
  67. package/rest/layerSources/typeUtils.js +2 -0
  68. package/rest/print.js +1 -1
  69. package/rest/query/operations/queryRelatedRecords.js +1 -1
  70. package/rest/query/operations/queryUtils.js +1 -1
  71. package/rest/support/Query.js +1 -1
  72. package/rest/support/RelationshipQuery.js +1 -1
  73. package/symbols/LineSymbol3D.d.ts +5 -3
  74. package/views/2d/analysis/ElevationProfileAnalysisView2D.d.ts +6 -0
  75. package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
  76. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  77. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  78. package/views/3d/analysis/Dimension/DimensionVisualization.js +1 -1
  79. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  80. package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
  81. package/views/3d/analysis/ElevationProfileAnalysisView3D.d.ts +6 -0
  82. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  83. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  84. package/views/3d/analysis/LineOfSight/LineOfSightObserverPlugin.js +1 -1
  85. package/views/3d/analysis/LineOfSight/LineOfSightTargetPlugin.js +1 -1
  86. package/views/3d/analysis/Viewshed/ViewshedFieldOfViewManipulation.js +1 -1
  87. package/views/3d/analysis/Viewshed/ViewshedPlacementPointPlugin.js +1 -1
  88. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  89. package/views/3d/input/SceneInputManager.js +1 -1
  90. package/views/3d/input/handlers/DragZoom.js +1 -1
  91. package/views/3d/input/handlers/MouseWheelFov.js +1 -1
  92. package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
  93. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  94. package/views/3d/interactive/manipulators/ResizeManipulator.js +1 -1
  95. package/views/3d/interactive/manipulators/RotateManipulator.js +1 -1
  96. package/views/3d/interactive/manipulators/ShiftManipulator.js +1 -1
  97. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  98. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  99. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  100. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  101. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  102. package/views/3d/layers/FlowSubView3D.js +1 -1
  103. package/views/3d/layers/I3SMeshView3D.js +1 -1
  104. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  105. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  106. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  107. package/views/3d/layers/graphics/extrudePolygon.js +1 -1
  108. package/views/3d/layers/graphics/tessellationUtils.js +1 -1
  109. package/views/3d/state/controllers/FovController.js +1 -1
  110. package/views/3d/state/controllers/GroundNavigationController.js +1 -1
  111. package/views/3d/state/controllers/momentum/GroundNavigationMomentumController.js +1 -1
  112. package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
  113. package/views/3d/support/elevationUpdateUtils.js +1 -1
  114. package/views/3d/terrain/PatchRenderData.js +1 -1
  115. package/views/3d/terrain/TerrainData.js +1 -1
  116. package/views/3d/terrain/TextureReference.js +1 -1
  117. package/views/3d/terrain/terrainUtils.js +1 -1
  118. package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +2 -2
  119. package/views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js +3 -3
  120. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialExternalColor.glsl.js +2 -2
  121. package/views/3d/webgl-engine/core/shaderLibrary/output/getEmissions.glsl.js +2 -2
  122. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  123. package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
  124. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  125. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  126. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  127. package/views/BreakpointsOwner.d.ts +6 -0
  128. package/views/SceneView.js +1 -1
  129. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  130. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  131. package/views/interactive/editGeometry/operations/RotateVertex.js +1 -1
  132. package/views/interactive/editGeometry/operations/ScaleVertex.js +1 -1
  133. package/views/interactive/editGeometry/operations/SetAllVertexPositions.js +1 -1
  134. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  135. package/views/types.d.ts +3 -0
  136. package/views/webgl/ShaderBuilder.js +1 -1
  137. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  138. package/widgets/Search/LocatorSearchSource.d.ts +22 -1
  139. package/widgets/support/SelectionList/GroupLayerItem.d.ts +2 -0
  140. package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
  141. package/widgets/support/SelectionList/ItemBase.d.ts +2 -0
  142. package/widgets/support/SelectionList/ItemBase.js +1 -1
  143. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  144. package/widgets/support/SelectionList.js +1 -1
  145. package/assets/esri/core/workers/chunks/3e3e076fa5e8d5d5f33f.js +0 -1
  146. package/assets/esri/core/workers/chunks/510502a4c9a2ba8d3f7b.js +0 -1
  147. package/assets/esri/core/workers/chunks/7d212c415f2709037408.js +0 -1
  148. package/assets/esri/core/workers/chunks/abb9e820d2871fa7acae.js +0 -1
  149. package/assets/esri/core/workers/chunks/ade5fdcd08dcbac74740.js +0 -1
  150. package/assets/esri/core/workers/chunks/b390b9cde2884755e8be.js +0 -1
  151. package/assets/esri/core/workers/chunks/e8bf653376a607f00897.js +0 -1
  152. package/assets/esri/core/workers/chunks/f4a7aa3cdbc0c429c359.js +0 -1
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{lengthDimensionMeasureType as e}from"../../../../analysis/dimensionUtils.js";import{cyclicalDegrees as t}from"../../../../core/Cyclical.js";import{rad2deg as n}from"../../../../core/mathUtils.js";import{watch as r,initial as i}from"../../../../core/reactiveUtils.js";import{pt2px as a}from"../../../../core/screenUtils.js";import{identity as o,scale as s}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{scale as l,copy as u,exactEquals as d,length as f,set as p,sub as m,subtract as h,cross as g,dot as ee}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _,ZEROS as v,fromValues as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as te}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import ne from"../../../../geometry/Point.js";import{fromPositionAndNormal as b,create as x,signedDistance as re,getNormal as ie}from"../../../../geometry/support/plane.js";import{sv3d as S}from"../../../../geometry/support/vectorStacks.js";import{clonePoint as ae}from"../../../../layers/graphics/hydratedFeatures.js";import{isValidComputation as C,computeOffsetForPoint as oe,computeSegmentForMeasureType as se,computeOffsetAxis as ce,dimensionStartToEnd as le,headingFromGeometry as w,computeGeometryFromDimension as ue,computationToGeometryDependencies as T,directUp as E,directStartToEnd as D}from"./lengthDimensionUtils.js";import{getTransparentAccentColor as O,pointRadius as de,lengthFraction as k,minLengthMeters as fe,linePaddingPx as pe,focusedLinePaddingPx as me,orientationFocusMultiplier as he,orientationDiscScale as ge,orientationCalloutWidth as _e,markerLineSizeFraction as ve,orientationCalloutOffsetPx as ye,orientationSnapThresholdDegrees as be}from"./settings.js";import{Manipulator3D as A}from"../../interactive/Manipulator3D.js";import{createManipulatorMaterial as xe,worldScaledManipulatorSettings as j,calculateTranslateRotateFromBases as M,rotateManipulatorDefaults as N,calculateInputRotationTransform as Se}from"../../interactive/manipulatorUtils.js";import{RenderObject as P}from"../../interactive/RenderObject.js";import{screenToMap3D as Ce,hideManipulatorWhileDragging as F,screenToRenderPlane as I}from"../../interactive/editingTools/dragEventPipeline3D.js";import{EuclideanSegment as we}from"../../interactive/visualElements/support/Segment.js";import{markerSizePerLineWidth as Te}from"../../support/engineContent/marker.js";import{Attribute as L}from"../../webgl-engine/lib/Attribute.js";import{Geometry as Ee}from"../../webgl-engine/lib/Geometry.js";import{createSphereGeometry as De,createPolylineGeometry as R}from"../../webgl-engine/lib/GeometryUtil.js";import{RibbonLineMaterial as Oe}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createManipulatorDragEventPipeline as z,resetProperties as B,EventPipeline as ke}from"../../../interactive/dragEventPipeline.js";class Ae{constructor(e){this.start=e.start,this.end=e.end,this.offset=e.offset,this.heading=e.heading,this.rotation=e.rotation,this.direct=e.direct,this.horizontal=e.horizontal,this.vertical=e.vertical}manipulatorName(e){return Object.keys(this).find(t=>this.hasOwnProperty(t)&&e===this[t])}values(){return[this.start,this.end,this.offset,this.heading,this.rotation,this.direct,this.horizontal,this.vertical]}forEachMeasureTypeManipulator(t){for(let n of e)t(this.manipulatorForMeasureType(n),n)}manipulatorForMeasureType(e){switch(e){case`direct`:return this.direct;case`horizontal`:return this.horizontal;case`vertical`:return this.vertical}}}class je extends A{constructor(e,t){let n=xe(O(e.effectiveTheme).toUnitRGBA()),i=[new P(De(n,1,32,32),X)];super({view:e,renderObjects:i,metadata:t.metadata,available:!1,grabCursor:`crosshair`,radius:de,collisionPriority:1}),this._themeHandle=r(()=>({color:O(e.effectiveTheme).toUnitRGBA()}),e=>n.setParameters(e))}destroy(){this._themeHandle.remove(),super.destroy()}}function Me(e,t){let n=[y(-.5,0,0),y(.5,0,0)],r=R(t.unfocusedMaterial,n.map(e=>l(_(),e,k))),i=r.instantiate({material:t.focusedMaterial});return new A({view:e,renderObjects:[new P(r,9|X),new P(i,2|X)],collisionType:{type:`line`,paths:[n]},radius:J(t.lineSizePt)/2,metadata:t.metadata,available:!1,...j})}class Ne extends A{constructor(e,{lineSizePt:t,material:n,metadata:a}){super({view:e,autoScaleRenderObjects:!1,collisionPriority:1,metadata:a}),this._options={calloutColor:te(),lineSizePt:t,material:n},this._themeHandle=r(()=>O(e.effectiveTheme).toUnitRGBA(),e=>{this._options.calloutColor=e,Y(this,V({...this._options,metadata:this.metadata}))},i)}update({lineSizePt:e,material:t}){this._options.lineSizePt=e,this._options.material=t,Y(this,V({...this._options,metadata:this.metadata}))}destroy(){this._themeHandle.remove(),super.destroy()}}function V({calloutColor:e,lineSizePt:t,material:n,metadata:r}){return{calloutLength:.25*Te*ve*a(t)+ye,calloutColor:e,calloutWidth:_e,customStateMask:X,discScale:ge,focusMultiplier:he,material:n,metadata:r}}function Pe(e,t){let n=[y(-.5,0,0),y(.5,0,0)],r=R(t.thinOffsetManipulatorMaterial,n),i=R(t.unfocusedMaterial,n.map(e=>l(_(),e,k))),a=i.instantiate({material:t.focusedMaterial});return new A({view:e,renderObjects:[new P(i,1|X),new P(a,2|X),new P(r,X)],collisionType:{type:`line`,paths:[n]},radius:J(t.lineSizePt)/2,available:!1,metadata:t.metadata,...j})}function Fe(e,{isStart:t,createSnappingPipelineStep:n,dimension:r,onUpdate:i,view:a}){let o=t?`startPoint`:`endPoint`;return[z(e,(e,t,s,c)=>{let l=F(e),{snappingStep:u,cancelSnapping:d}=n(c);s.next(l).next(B(r,[o,`measureType`,`orientation`])).next(d),t.next(l).next(Ce(a)).next(...u).next(e=>{let t=ae(e.mapEnd,new ne);i(o===`startPoint`?{startPoint:t}:{endPoint:t})})})]}function Ie(e,{computation:t,view:n}){return[z(e,(e,r,i)=>{if(!C(t)||!e.selected)return;let{geometry:a,dimension:o}=t,s=F(e);r.next(s).next(W(n,o,a.dimensionSegment,a.primaryOffsetAxis)),i.next(s).next(B(o,[`offset`]))})]}function Le(e,{computation:t,view:n}){return[z(e,(e,r,i)=>{H({cancel:i,computation:t,settingHeading:!0,steps:r,view:n})})]}function Re(e,{computation:t,view:n}){return[z(e,(e,r,i)=>{H({cancel:i,computation:t,settingHeading:!1,steps:r,view:n})}),e.events.on(`immediate-click`,e=>{ze(e,t,n)})]}function ze(e,n,r){let{dimension:i,geometry:a}=n;if(i.orientation===90||i.orientation===270){i.orientation=0,e.stopPropagation();return}if(a==null)return;let{renderCoordsHelper:o}=r,s=ue({...T(n),orientation:90},o),c=ue({...T(n),orientation:270},o);if(s==null||c==null)return;let l=w(s,o),u=w(c,o),d=G(a,r),f=t.shortestSignedDiff(d,l),p=t.shortestSignedDiff(d,u);i.orientation=Math.abs(f)<Math.abs(p)?90:270,e.stopPropagation()}function H(e){let{cancel:t,computation:r,settingHeading:i,steps:a,view:o}=e;if(!C(r))return;let{renderCoordsHelper:s}=o,{dimension:c,geometry:l}=r,d=_(),f=q(_(),l,l.directSegment,s),p=qe(S.get(),{forHeading:i,geometry:l,renderCoordsHelper:s}),m=b(f,p,x()),h=i?c.orientation??w(l,o.renderCoordsHelper):c.orientation??0;a.next(I(o,m)).next(e=>{e.action===`start`&&u(d,e.renderStart);let t=ie(m),r=Se(d,e.renderEnd,f,t),a=h-n(r);i||(a=U(a)),c.orientation=a}),t.next(B(c,[`orientation`]))}function U(e){let n=t.normalize(e)%90;return n<be?e-n:90-n<be?e+(90-n):e}function Be(e,{computation:t,manipulatorMeasureType:n,view:r}){let i=`direct`,a=0,o=0;return[e.events.on(`grab-changed`,s=>{if(s.action!==`start`||!C(t))return;let{dimension:c,geometry:l}=t;i=c.measureType,a=c.offset,o=c.orientation;let d=u(S.get(),e.renderLocation);c.measureType=n,c.offset=oe(d,n,l,r.renderCoordsHelper),c.orientation=0}),z(e,(e,s,c)=>{if(!C(t))return;let{geometry:l,dimension:u}=t,{renderCoordsHelper:d}=r,f=se(Qe,n,t,d),p=ce(S.get(),{measureType:n,directSegment:l.directSegment,renderCoordsHelper:d}),m=F(e);s.next(m).next(W(r,u,f,p)),c.next(m).next(e=>(u.measureType=i,u.offset=a,u.orientation=o,e))})]}function W(e,t,n,r){let i=h(S.get(),n.endRenderSpace,n.startRenderSpace);g(i,i,r);let a=b(n.startRenderSpace,i,x()),o=b(n.startRenderSpace,r,x()),s=t.offset,c=0,l,u=new ke;return u.next(I(e,a)).next(n=>{n.action===`start`&&(c=re(o,n.renderStart));let r=(re(o,n.renderEnd)-c)*e.renderCoordsHelper.unitInMeters;t.offset=s+r,l=n}),e=>(u.execute(e),l)}function G(e,t){let{directSegment:n}=e,{renderCoordsHelper:r}=t,i=E(S.get(),e,r),a=D(S.get(),e),o=g(S.get(),a,i),{viewForward:s}=t.state.camera;ee(o,s)>0&&l(o,o,-1);let c=n.eval(.5,S.get());return r.headingAtPosition(c,o)}function Ve(e,t,n){let{dimensionSegment:r,primaryOffsetAxis:i}=t,a=le(Z,t),c=d(a,v)?o($):M(a,i,v,$),l=Math.max(f(a),fe/n.unitInMeters);s(c,c,p(Z,l,l,l)),e.modelTransform=c,e.renderLocation=r.eval(.5,Z)}function He(e,t,n){K(e,t,n,{forHeading:!0})}function Ue(e,t,n){K(e,t,n,{forHeading:!1})}function K(e,t,n,{forHeading:r}){let{dimension:i,geometry:a}=t,{primaryOffsetAxis:o}=a,s=l(We,o,i.offset>=0?1:-1),c=qe(Ge,{forHeading:r,geometry:a,renderCoordsHelper:n});g(c,c,s),e.modelTransform=M(s,c,v,$),e.renderLocation=q(Z,a,a.dimensionSegment,n)}const We=_(),Ge=_();function Ke(e,t,n,r){let{geometry:i}=t,a=se(Qe,n,t,r),o=ce(Z,{measureType:n,directSegment:i.directSegment,renderCoordsHelper:r}),c=m(Q,a.endRenderSpace,a.startRenderSpace),l=M(c,o,v,$),u=f(c);s(l,l,p(Q,u,u,u)),e.modelTransform=l,e.renderLocation=a.eval(.5,Q)}function q(e,t,n,r){let{startRenderSpace:i,endRenderSpace:a}=n,o=Je(t,r)?i:a;return u(e,o)}function qe(e,{forHeading:t,geometry:n,renderCoordsHelper:r}){return t?E(e,n,r):le(e,n,{invert:!0})}function Je(e,t){let n=D(Ye,e),r=E(Xe,e,t);return ee(n,r)>0}const Ye=_(),Xe=_();function Ze(e){return a(e)+pe}function J(e){return a(e)+me}function Y(e,t){let n=t.material,r=t.focusMultiplier??N.focusMultiplier,i=t.calloutLength??N.calloutLength,a=N.discRadius*(t.discScale??1),o=a*r,s=(e,t)=>{let n=[0,1,2,2,3,0];return new Ee(t,[[`position`,new L([i-e,-e,0,i+e,-e,0,i+e,e,0,i-e,e,0],n,3,!0)],[`uv0`,new L([0,0,1,0,1,1,0,1],n,2,!0)]])},c=t.calloutWidth??N.calloutWidth,l=new Oe({width:c,color:t.calloutColor,renderOccluded:4,isDecoration:!0},e.view.state.isGlobal),u=R(l,[[0,0,0],[i-a,0,0]]),d=R(l,[[0,0,0],[i-o,0,0]]),f=t.customStateMask??0;e.collisionType={type:`disc`,direction:[0,0,1],offset:[i,0,0]},e.focusMultiplier=r,e.metadata=t.metadata,e.radius=a,e.renderObjects=[new P(s(a,n),1|f),new P(u,1|f),new P(s(o,n),2|f),new P(d,2|f)]}const X=16,Z=_(),Q=_(),$=c(),Qe=new we;export{X as DidPointerMoveRecentlyFlag,Ae as LengthDimensionManipulators,je as LengthDimensionPointManipulator,Ne as LineOfSightOrientationManipulator,G as automaticHeadingFromCamera,Pe as createMeasureTypeManipulator,Me as createOffsetManipulator,J as focusedOffsetWidth,Le as headingManipulatorHandles,Be as measureTypeManipulatorHandles,Ie as offsetManipulatorHandles,Fe as pointManipulatorHandles,Re as rotationManipulatorHandles,U as snapOrientationToNearestRightAngle,Ze as unfocusedOffsetWidth,He as updateHeadingManipulatorTransform,Ke as updateMeasureTypeManipulatorTransform,Ve as updateOffsetManipulatorTransform,Ue as updateRotationManipulatorTransform};
2
+ import{lengthDimensionMeasureType as e}from"../../../../analysis/dimensionUtils.js";import{cyclicalDegrees as t}from"../../../../core/Cyclical.js";import{rad2deg as n}from"../../../../core/mathUtils.js";import{watch as r,initial as i}from"../../../../core/reactiveUtils.js";import{pt2px as a}from"../../../../core/screenUtils.js";import{identity as o,scale as s}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{scale as l,copy as u,exactEquals as d,length as f,set as p,sub as m,subtract as h,cross as g,dot as ee}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _,ZEROS as v,fromValues as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as te}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import ne from"../../../../geometry/Point.js";import{fromPositionAndNormal as b,create as x,signedDistance as re,getNormal as ie}from"../../../../geometry/support/plane.js";import{sv3d as S}from"../../../../geometry/support/vectorStacks.js";import{clonePoint as ae}from"../../../../layers/graphics/hydratedFeatures.js";import{isValidComputation as C,computeOffsetForPoint as oe,computeSegmentForMeasureType as se,computeOffsetAxis as ce,dimensionStartToEnd as le,headingFromGeometry as w,computeGeometryFromDimension as ue,computationToGeometryDependencies as T,directUp as E,directStartToEnd as D}from"./lengthDimensionUtils.js";import{getTransparentAccentColor as O,pointRadius as de,lengthFraction as k,minLengthMeters as fe,linePaddingPx as pe,focusedLinePaddingPx as me,orientationFocusMultiplier as he,orientationDiscScale as ge,orientationCalloutWidth as _e,markerLineSizeFraction as ve,orientationCalloutOffsetPx as ye,orientationSnapThresholdDegrees as be}from"./settings.js";import{Manipulator3D as A}from"../../interactive/Manipulator3D.js";import{createManipulatorMaterial as xe,worldScaledManipulatorSettings as j,calculateTranslateRotateFromBases as M,rotateManipulatorDefaults as N,calculateInputRotationTransform as Se}from"../../interactive/manipulatorUtils.js";import{RenderObject as P}from"../../interactive/RenderObject.js";import{screenToMap3D as Ce,hideManipulatorWhileDragging as F,screenToRenderPlane as I}from"../../interactive/editingTools/dragEventPipeline3D.js";import{EuclideanSegment as we}from"../../interactive/visualElements/support/Segment.js";import{markerSizePerLineWidth as Te}from"../../support/engineContent/marker.js";import{Attribute as L}from"../../webgl-engine/lib/Attribute.js";import{Geometry as Ee}from"../../webgl-engine/lib/Geometry.js";import{createSphereGeometry as De,createPolylineGeometry as R}from"../../webgl-engine/lib/GeometryUtil.js";import{RibbonLineMaterial as Oe}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createManipulatorDragEventPipeline as z,resetProperties as B,EventPipeline as ke}from"../../../interactive/dragEventPipeline.js";class Ae{constructor(e){this.start=e.start,this.end=e.end,this.offset=e.offset,this.heading=e.heading,this.rotation=e.rotation,this.direct=e.direct,this.horizontal=e.horizontal,this.vertical=e.vertical}manipulatorName(e){return Object.keys(this).find(t=>this.hasOwnProperty(t)&&e===this[t])}values(){return[this.start,this.end,this.offset,this.heading,this.rotation,this.direct,this.horizontal,this.vertical]}forEachMeasureTypeManipulator(t){for(let n of e)t(this.manipulatorForMeasureType(n),n)}manipulatorForMeasureType(e){switch(e){case`direct`:return this.direct;case`horizontal`:return this.horizontal;case`vertical`:return this.vertical}}}class je extends A{constructor(e,t){let n=xe(O(e.effectiveTheme).toUnitRGBA()),i=[new P(De(n,1,32,32),X)];super({view:e,renderObjects:i,metadata:t.metadata,available:!1,grabCursor:`crosshair`,radius:de,collisionPriority:1}),this._themeHandle=r(()=>({color:O(e.effectiveTheme).toUnitRGBA()}),e=>n.setParameters(e))}destroy(){this._themeHandle.remove(),super.destroy()}}function Me(e,t){let n=[y(-.5,0,0),y(.5,0,0)],r=R(t.unfocusedMaterial,n.map(e=>l(_(),e,k))),i=r.instantiate({material:t.focusedMaterial});return new A({view:e,renderObjects:[new P(r,9|X),new P(i,2|X)],collisionType:{type:`line`,paths:[n]},radius:J(t.lineSizePt)/2,metadata:t.metadata,available:!1,...j})}class Ne extends A{constructor(e,{lineSizePt:t,material:n,metadata:a}){super({view:e,autoScaleRenderObjects:!1,collisionPriority:1,metadata:a}),this._options={calloutColor:te(),lineSizePt:t,material:n},this._themeHandle=r(()=>O(e.effectiveTheme).toUnitRGBA(),e=>{this._options.calloutColor=e,Y(this,V({...this._options,metadata:this.metadata}))},i)}update({lineSizePt:e,material:t}){this._options.lineSizePt=e,this._options.material=t,Y(this,V({...this._options,metadata:this.metadata}))}destroy(){this._themeHandle.remove(),super.destroy()}}function V({calloutColor:e,lineSizePt:t,material:n,metadata:r}){return{calloutLength:.25*Te*ve*a(t)+ye,calloutColor:e,calloutWidth:_e,customStateMask:X,discScale:ge,focusMultiplier:he,material:n,metadata:r}}function Pe(e,t){let n=[y(-.5,0,0),y(.5,0,0)],r=R(t.thinOffsetManipulatorMaterial,n),i=R(t.unfocusedMaterial,n.map(e=>l(_(),e,k))),a=i.instantiate({material:t.focusedMaterial});return new A({view:e,renderObjects:[new P(i,1|X),new P(a,2|X),new P(r,X)],collisionType:{type:`line`,paths:[n]},radius:J(t.lineSizePt)/2,available:!1,metadata:t.metadata,...j})}function Fe(e,{isStart:t,createSnappingPipelineStep:n,dimension:r,onUpdate:i,view:a}){let o=t?`startPoint`:`endPoint`;return[z(e,(e,t,s,c)=>{let l=F(e),{snappingStep:u,cancelSnapping:d}=n(c);s.next(l).next(B(r,[o,`measureType`,`orientation`])).next(d),t.next(l).next(Ce(a)).next(...u).next(e=>{let t=ae(e.mapEnd,new ne);i(o===`startPoint`?{startPoint:t}:{endPoint:t})})})]}function Ie(e,{computation:t,view:n}){return[z(e,(e,r,i)=>{if(!C(t)||!e.selected)return;let{geometry:a,dimension:o}=t,s=F(e);r.next(s).next(W(n,o,a.dimensionSegment,a.primaryOffsetAxis)),i.next(s).next(B(o,[`offset`]))})]}function Le(e,{computation:t,view:n}){return[z(e,(e,r,i)=>{H({cancel:i,computation:t,settingHeading:!0,steps:r,view:n})})]}function Re(e,{computation:t,view:n}){return[z(e,(e,r,i)=>{H({cancel:i,computation:t,settingHeading:!1,steps:r,view:n})}),e.events.on(`immediate-click`,e=>{ze(e,t,n)})]}function ze(e,n,r){let{dimension:i,geometry:a}=n;if(i.orientation===90||i.orientation===270){i.orientation=0,e.stopPropagation();return}if(a==null)return;let{renderCoordsHelper:o}=r,s=ue({...T(n),orientation:90},o),c=ue({...T(n),orientation:270},o);if(s==null||c==null)return;let l=w(s,o),u=w(c,o),d=G(a,r),f=t.shortestSignedDiff(d,l),p=t.shortestSignedDiff(d,u);i.orientation=Math.abs(f)<Math.abs(p)?90:270,e.stopPropagation()}function H(e){let{cancel:t,computation:r,settingHeading:i,steps:a,view:o}=e;if(!C(r))return;let{renderCoordsHelper:s}=o,{dimension:c,geometry:l}=r,d=_(),f=q(_(),l,l.directSegment,s),p=qe(S.get(),{forHeading:i,geometry:l,renderCoordsHelper:s}),m=b(f,p,x()),h=i?c.orientation??w(l,o.renderCoordsHelper):c.orientation??0;a.next(I(o,m)).next(e=>{e.action===`start`&&u(d,e.renderStart);let t=ie(m),r=Se(d,e.renderEnd,f,t),a=h-n(r);i||(a=U(a)),c.orientation=a}),t.next(B(c,[`orientation`]))}function U(e){let n=t.normalize(e)%90;return n<be?e-n:90-n<be?e+(90-n):e}function Be(e,{computation:t,manipulatorMeasureType:n,view:r}){let i=`direct`,a=0,o=0;return[e.events.on(`grab-changed`,s=>{if(s.action!==`start`||!C(t))return;let{dimension:c,geometry:l}=t;i=c.measureType,a=c.offset,o=c.orientation;let d=u(S.get(),e.renderLocation);c.measureType=n,c.offset=oe(d,n,l,r.renderCoordsHelper),c.orientation=0}),z(e,(e,s,c)=>{if(!C(t))return;let{geometry:l,dimension:u}=t,{renderCoordsHelper:d}=r,f=se(Qe,n,t,d),p=ce(S.get(),{measureType:n,directSegment:l.directSegment,renderCoordsHelper:d}),m=F(e);s.next(m).next(W(r,u,f,p)),c.next(m).next(e=>(u.measureType=i,u.offset=a,u.orientation=o,e))})]}function W(e,t,n,r){let i=h(S.get(),n.endRenderSpace,n.startRenderSpace);g(i,i,r);let a=b(n.startRenderSpace,i,x()),o=b(n.startRenderSpace,r,x()),s=t.offset,c=0,l,u=new ke;return u.next(I(e,a)).next(n=>{n.action===`start`&&(c=re(o,n.renderStart));let r=(re(o,n.renderEnd)-c)*e.renderCoordsHelper.unitInMeters;t.offset=s+r,l=n}),e=>(u.execute(e),l)}function G(e,t){let{directSegment:n}=e,{renderCoordsHelper:r}=t,i=E(S.get(),e,r),a=D(S.get(),e),o=g(S.get(),a,i),{viewForward:s}=t.state.camera;ee(o,s)>0&&l(o,o,-1);let c=n.eval(.5,S.get());return r.headingAtPosition(c,o)}function Ve(e,t,n){let{dimensionSegment:r,primaryOffsetAxis:i}=t,a=le(Z,t),c=d(a,v)?o($):M(a,i,v,$),l=Math.max(f(a),fe/n.unitInMeters);s(c,c,p(Z,l,l,l)),e.modelTransform=c,e.renderLocation=r.eval(.5,Z)}function He(e,t,n){K(e,t,n,{forHeading:!0})}function Ue(e,t,n){K(e,t,n,{forHeading:!1})}function K(e,t,n,{forHeading:r}){let{dimension:i,geometry:a}=t,{primaryOffsetAxis:o}=a,s=l(We,o,i.offset>=0?1:-1),c=qe(Ge,{forHeading:r,geometry:a,renderCoordsHelper:n});g(c,c,s),e.modelTransform=M(s,c,v,$),e.renderLocation=q(Z,a,a.dimensionSegment,n)}const We=_(),Ge=_();function Ke(e,t,n,r){let{geometry:i}=t,a=se(Qe,n,t,r),o=ce(Z,{measureType:n,directSegment:i.directSegment,renderCoordsHelper:r}),c=m(Q,a.endRenderSpace,a.startRenderSpace),l=M(c,o,v,$),u=f(c);s(l,l,p(Q,u,u,u)),e.modelTransform=l,e.renderLocation=a.eval(.5,Q)}function q(e,t,n,r){let{startRenderSpace:i,endRenderSpace:a}=n,o=Je(t,r)?i:a;return u(e,o)}function qe(e,{forHeading:t,geometry:n,renderCoordsHelper:r}){return t?E(e,n,r):le(e,n,{invert:!0})}function Je(e,t){let n=D(Ye,e),r=E(Xe,e,t);return ee(n,r)>0}const Ye=_(),Xe=_();function Ze(e){return a(e)+pe}function J(e){return a(e)+me}function Y(e,t){let n=t.material,r=t.focusMultiplier??N.focusMultiplier,i=t.calloutLength??N.calloutLength,a=N.discRadius*(t.discScale??1),o=a*r,s=(e,t)=>{let n=[0,1,2,2,3,0];return new Ee(t,[[`position`,new L([i-e,-e,0,i+e,-e,0,i+e,e,0,i-e,e,0],n,3,!0)],[`uv0`,new L([0,0,1,0,1,1,0,1],n,2,!0)]])},c=t.calloutWidth??N.calloutWidth,l=new Oe({width:c,color:t.calloutColor,renderOccluded:4,isDecoration:!0},e.view),u=R(l,[[0,0,0],[i-a,0,0]]),d=R(l,[[0,0,0],[i-o,0,0]]),f=t.customStateMask??0;e.collisionType={type:`disc`,direction:[0,0,1],offset:[i,0,0]},e.focusMultiplier=r,e.metadata=t.metadata,e.radius=a,e.renderObjects=[new P(s(a,n),1|f),new P(u,1|f),new P(s(o,n),2|f),new P(d,2|f)]}const X=16,Z=_(),Q=_(),$=c(),Qe=new we;export{X as DidPointerMoveRecentlyFlag,Ae as LengthDimensionManipulators,je as LengthDimensionPointManipulator,Ne as LineOfSightOrientationManipulator,G as automaticHeadingFromCamera,Pe as createMeasureTypeManipulator,Me as createOffsetManipulator,J as focusedOffsetWidth,Le as headingManipulatorHandles,Be as measureTypeManipulatorHandles,Ie as offsetManipulatorHandles,Fe as pointManipulatorHandles,Re as rotationManipulatorHandles,U as snapOrientationToNearestRightAngle,Ze as unfocusedOffsetWidth,He as updateHeadingManipulatorTransform,Ke as updateMeasureTypeManipulatorTransform,Ve as updateOffsetManipulatorTransform,Ue as updateRotationManipulatorTransform};
@@ -38,6 +38,12 @@ import type { ElevationProfileStatistics, ElevationProfileEffectiveDisplayUnits,
38
38
  export default abstract class ElevationProfileAnalysisView3D extends AnalysisView3D {
39
39
  /** The elevation profile analysis associated with the analysis view. */
40
40
  get analysis(): ElevationProfileAnalysis;
41
+ /**
42
+ * Whether placement has at least two committed vertices and can be stopped.
43
+ *
44
+ * @internal
45
+ */
46
+ get canStopPlacing(): boolean;
41
47
  /**
42
48
  * Units used for all the [results](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/ElevationProfileAnalysisView3D/#results) and [statistics](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/ElevationProfileAnalysisView3D/#statistics) of the elevation profile analysis.
43
49
  *
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Collection.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import i from"./AnalysisView3D.js";import{ElevationProfileLineSceneComputation as a}from"./ElevationProfile/ElevationProfileLineSceneComputation.js";import{ElevationProfileVisualization3D as o}from"./ElevationProfile/ElevationProfileVisualization3D.js";import{ElevationProfileController as s}from"../../analysis/ElevationProfile/ElevationProfileController.js";import{ElevationProfileLineGroundComputation as c}from"../../analysis/ElevationProfile/ElevationProfileLineGroundComputation.js";import{ElevationProfileLineInputComputation as l}from"../../analysis/ElevationProfile/ElevationProfileLineInputComputation.js";import{ElevationProfileLineQueryComputation as u}from"../../analysis/ElevationProfile/ElevationProfileLineQueryComputation.js";import{ElevationProfileTool as d}from"../../analysis/ElevationProfile/ElevationProfileTool.js";let f=class extends i{constructor(e){super(e),this.type=`elevation-profile-view-3d`,this.analysis=null,this.indicatorRelativePosition=null}initialize(){let{analysis:e,view:t}=this;this._controller=new s({analysis:e,analysisViewData:this,view:t,computationFactory:{create:e=>{switch(e.profile.type){case`ground`:return new c(e);case`input`:return new l(e);case`query`:return new u(e);case`scene`:return new a(e)}}}}),this._visualization=new o({view:t,analysisViewData:this}),this._sketchTool=new d({view:t,analysisViewData:this})}destroy(){this._controller?.destroy(),this._visualization?.destroy(),this._sketchTool?.destroy()}get effectiveDisplayUnits(){return this._controller?.effectiveDisplayUnits??{distance:`meters`,elevation:`meters`}}get error(){return this._controller?.error}get flatProfiles(){return this._controller?.flatProfiles??m}get indicatorPoints(){return this._controller?.indicatorPoints??[]}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get progress(){return this._controller?.progress??0}get results(){return this._controller?.results??[]}get statistics(){return this._controller?.statistics}get updating(){return this._controller?.updating===!0||this._visualization?.updating===!0||this._sketchTool?.updating===!0}get visible(){return super.visible}set visible(e){super.visible=e}get sketchGraphic(){return this._sketchTool?.sketchGraphic}get toolState(){return this._sketchTool?.state??`idle`}place(e){return this._sketchTool.place(e)}pickFeature(e){return this._sketchTool.pickFeature(e)}get testData(){return{visualization:this._visualization}}};e([n({readOnly:!0})],f.prototype,`type`,void 0),e([n({constructOnly:!0,nonNullable:!0})],f.prototype,`analysis`,void 0),e([n({readOnly:!0})],f.prototype,`effectiveDisplayUnits`,null),e([n({readOnly:!0})],f.prototype,`error`,null),e([n()],f.prototype,`flatProfiles`,null),e([n()],f.prototype,`indicatorRelativePosition`,void 0),e([n()],f.prototype,`indicatorPoints`,null),e([n({readOnly:!0})],f.prototype,`progress`,null),e([n({readOnly:!0})],f.prototype,`results`,null),e([n({readOnly:!0})],f.prototype,`statistics`,null),e([n({readOnly:!0})],f.prototype,`updating`,null),e([n()],f.prototype,`sketchGraphic`,null),e([n()],f.prototype,`toolState`,null),e([n()],f.prototype,`_controller`,void 0),e([n()],f.prototype,`_visualization`,void 0),e([n()],f.prototype,`_sketchTool`,void 0),f=e([r(`esri.views.3d.analysis.ElevationProfileAnalysisView3D`)],f);const p=f,m=new t;export{p as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Collection.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import i from"./AnalysisView3D.js";import{ElevationProfileLineSceneComputation as a}from"./ElevationProfile/ElevationProfileLineSceneComputation.js";import{ElevationProfileVisualization3D as o}from"./ElevationProfile/ElevationProfileVisualization3D.js";import{ElevationProfileController as s}from"../../analysis/ElevationProfile/ElevationProfileController.js";import{ElevationProfileLineGroundComputation as c}from"../../analysis/ElevationProfile/ElevationProfileLineGroundComputation.js";import{ElevationProfileLineInputComputation as l}from"../../analysis/ElevationProfile/ElevationProfileLineInputComputation.js";import{ElevationProfileLineQueryComputation as u}from"../../analysis/ElevationProfile/ElevationProfileLineQueryComputation.js";import{ElevationProfileTool as d}from"../../analysis/ElevationProfile/ElevationProfileTool.js";let f=class extends i{constructor(e){super(e),this.type=`elevation-profile-view-3d`,this.analysis=null,this.indicatorRelativePosition=null}initialize(){let{analysis:e,view:t}=this;this._controller=new s({analysis:e,analysisViewData:this,view:t,computationFactory:{create:e=>{switch(e.profile.type){case`ground`:return new c(e);case`input`:return new l(e);case`query`:return new u(e);case`scene`:return new a(e)}}}}),this._visualization=new o({view:t,analysisViewData:this}),this._sketchTool=new d({view:t,analysisViewData:this})}destroy(){this._controller?.destroy(),this._visualization?.destroy(),this._sketchTool?.destroy()}get effectiveDisplayUnits(){return this._controller?.effectiveDisplayUnits??{distance:`meters`,elevation:`meters`}}get error(){return this._controller?.error}get flatProfiles(){return this._controller?.flatProfiles??m}get indicatorPoints(){return this._controller?.indicatorPoints??[]}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get progress(){return this._controller?.progress??0}get results(){return this._controller?.results??[]}get statistics(){return this._controller?.statistics}get updating(){return this._controller?.updating===!0||this._visualization?.updating===!0||this._sketchTool?.updating===!0}get visible(){return super.visible}set visible(e){super.visible=e}get sketchGraphic(){return this._sketchTool?.sketchGraphic}get toolState(){return this._sketchTool?.state??`idle`}get canStopPlacing(){return this._sketchTool?.canStopPlacing??!1}place(e){return this._sketchTool.place(e)}pickFeature(e){return this._sketchTool.pickFeature(e)}get testData(){return{visualization:this._visualization}}};e([n({readOnly:!0})],f.prototype,`type`,void 0),e([n({constructOnly:!0,nonNullable:!0})],f.prototype,`analysis`,void 0),e([n({readOnly:!0})],f.prototype,`effectiveDisplayUnits`,null),e([n({readOnly:!0})],f.prototype,`error`,null),e([n()],f.prototype,`flatProfiles`,null),e([n()],f.prototype,`indicatorRelativePosition`,void 0),e([n()],f.prototype,`indicatorPoints`,null),e([n({readOnly:!0})],f.prototype,`progress`,null),e([n({readOnly:!0})],f.prototype,`results`,null),e([n({readOnly:!0})],f.prototype,`statistics`,null),e([n({readOnly:!0})],f.prototype,`updating`,null),e([n()],f.prototype,`sketchGraphic`,null),e([n()],f.prototype,`toolState`,null),e([n()],f.prototype,`canStopPlacing`,null),e([n()],f.prototype,`_controller`,void 0),e([n()],f.prototype,`_visualization`,void 0),e([n()],f.prototype,`_sketchTool`,void 0),f=e([r(`esri.views.3d.analysis.ElevationProfileAnalysisView3D`)],f);const p=f,m=new t;export{p as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{equals as n}from"../../../../core/arrayUtils.js";import{equalsMaybe as r}from"../../../../core/maybe.js";import{property as i,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{equals as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{equals as s}from"../../../../geometry/support/ray.js";let c=class extends t{constructor(e){super(e)}clone(){return this}equals(e){return this.context?.type===e.context?.type&&(!this.context||!e.context||this.context.equals(e.context))&&this.id===e.id&&r(this.mapPoint,e.mapPoint)&&o(this.renderPoint,e.renderPoint)&&n(this.normal,e.normal)&&s(this.ray,e.ray)}};e([i({constructOnly:!0})],c.prototype,`context`,void 0),e([i({constructOnly:!0})],c.prototype,`id`,void 0),e([i({constructOnly:!0})],c.prototype,`mapPoint`,void 0),e([i({constructOnly:!0})],c.prototype,`renderPoint`,void 0),e([i({constructOnly:!0})],c.prototype,`normal`,void 0),e([i({constructOnly:!0})],c.prototype,`ray`,void 0),c=e([a(`esri.views.3d.analysis.LineOfSight.LineOfSightIntersectionResult`)],c);class l{constructor(e){this.graphic=e,this.type=`graphic`}equals(e){return e.type===this.type&&this.graphic===e.graphic}}class u{constructor(){this.type=`ground`}equals(e){return e.type===this.type}}const d=new u;class f{constructor(){this.type=`gaussian-splat`}equals(e){return e.type===this.type}}const p=new f;export{l as LineOfSightIntersectionContextGraphic,c as LineOfSightIntersectionResult,p as lineOfSightIntersectionContextGaussianSplat,d as lineOfSightIntersectionContextGround};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{equalsMaybe as n}from"../../../../core/maybe.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{equals as a,exactEquals as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{equals as s}from"../../../../geometry/support/ray.js";let c=class extends t{constructor(e){super(e)}clone(){return this}equals(e){return this.context?.type===e.context?.type&&(!this.context||!e.context||this.context.equals(e.context))&&this.id===e.id&&n(this.mapPoint,e.mapPoint)&&a(this.renderPoint,e.renderPoint)&&o(this.normal,e.normal)&&s(this.ray,e.ray)}};e([r({constructOnly:!0})],c.prototype,`context`,void 0),e([r({constructOnly:!0})],c.prototype,`id`,void 0),e([r({constructOnly:!0})],c.prototype,`mapPoint`,void 0),e([r({constructOnly:!0})],c.prototype,`renderPoint`,void 0),e([r({constructOnly:!0})],c.prototype,`normal`,void 0),e([r({constructOnly:!0})],c.prototype,`ray`,void 0),c=e([i(`esri.views.3d.analysis.LineOfSight.LineOfSightIntersectionResult`)],c);class l{constructor(e){this.graphic=e,this.type=`graphic`}equals(e){return e.type===this.type&&this.graphic===e.graphic}}class u{constructor(){this.type=`ground`}equals(e){return e.type===this.type}}const d=new u;class f{constructor(){this.type=`gaussian-splat`}equals(e){return e.type===this.type}}const p=new f;export{l as LineOfSightIntersectionContextGraphic,c as LineOfSightIntersectionResult,p as lineOfSightIntersectionContextGaussianSplat,d as lineOfSightIntersectionContextGround};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{watch as t,sync as n}from"../../../../core/reactiveUtils.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{lineOfSightPlacementLeafPluginMarker as a}from"./LineOfSightPlacementLeafPlugin.js";import{PluginBase as o}from"../../../draw/plugins/PluginBase.js";var s,c;const l=Symbol(`line-of-sight-observer-vertex`),u=Symbol(`line-of-sight-observer-plugin-marker`);let d=class extends o{constructor(){super(...arguments),this[s]=!0,this[c]=!0,this.observer=null,this.defaultCaptureMode=`capture-always`,this.inputMapPosition=null,this.preservedIntersection=null,this._interactiveHandle=null}static{s=u,c=a}start(e){super.start(e),this.preservedIntersection=null;let{session:r,positionOfLastUserInput:i}=e,a=this.defaultCaptureMode===`grabbable-object`?this.inputMapPosition??this._interactiveHandle?.outputMapPosition??i:this.inputMapPosition??i;a&&(this.defaultCaptureMode===`grabbable-object`||!this._interactiveHandle)&&r.appendOrReplacePoint(l,a),this._interactiveHandle||(this._interactiveHandle=e.createInteractiveHandle({defaultCaptureMode:this.defaultCaptureMode,inputMapPosition:this.defaultCaptureMode===`grabbable-object`?a??void 0:void 0},{elevationFieldProperties:{unlockOnVertexPlacement:!0}}),this.addHandles(t(()=>this._interactiveHandle?.outputMapPosition,e=>{e&&!this._isComplete&&this._session?.appendOrReplacePoint(l,e)},n),this._ownHandlesKey))}};e([r({constructOnly:!0})],d.prototype,`observer`,void 0),e([r()],d.prototype,`defaultCaptureMode`,void 0),e([r()],d.prototype,`inputMapPosition`,void 0),e([r()],d.prototype,`preservedIntersection`,void 0),e([r()],d.prototype,`_interactiveHandle`,void 0),d=e([i(`esri.views.3d.analysis.LineOfSight.LineOfSightObserverPlugin`)],d);function f(e){return!!e&&u in e}function p(e={}){return{uniqueId:Symbol(`line-of-sight-observer-plugin`),kind:[`vertex`],geometryType:`point`,hidden:!0,localizationKey:`leaf-point-segment`,icon:`point`,create:()=>new d(e)}}export{d as LineOfSightObserverPlugin,p as createLineOfSightObserverPluginConfiguration,f as isLineOfSightObserverPlugin,u as lineOfSightObserverPluginMarker};
2
+ import{__decorate as e}from"tslib";import{watch as t,sync as n}from"../../../../core/reactiveUtils.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{lineOfSightPlacementLeafPluginMarker as a}from"./LineOfSightPlacementLeafPlugin.js";import{PluginBase as o}from"../../../draw/plugins/PluginBase.js";var s,c;const l=Symbol(`line-of-sight-observer-vertex`),u=Symbol(`line-of-sight-observer-plugin-marker`);let d=class extends o{constructor(){super(...arguments),this[s]=!0,this[c]=!0,this.observer=null,this.defaultCaptureMode=`capture-always`,this.inputMapPosition=null,this.preservedIntersection=null,this._interactiveHandle=null}static{s=u,c=a}start(e){super.start(e),this.preservedIntersection=null;let{session:r,positionOfLastUserInput:i}=e,a=this.defaultCaptureMode===`grabbable-object`?this.inputMapPosition??this._interactiveHandle?.outputMapPosition??i:this.inputMapPosition??i;a&&(this.defaultCaptureMode===`grabbable-object`||!this._interactiveHandle)&&r.appendOrReplacePoint(l,a),this._interactiveHandle||(this._interactiveHandle=e.createInteractiveHandle({defaultCaptureMode:this.defaultCaptureMode,inputMapPosition:this.defaultCaptureMode===`grabbable-object`?a??void 0:void 0}),this.addHandles(t(()=>this._interactiveHandle?.outputMapPosition,e=>{e&&!this._isComplete&&this._session?.appendOrReplacePoint(l,e)},n),this._ownHandlesKey))}};e([r({constructOnly:!0})],d.prototype,`observer`,void 0),e([r()],d.prototype,`defaultCaptureMode`,void 0),e([r()],d.prototype,`inputMapPosition`,void 0),e([r()],d.prototype,`preservedIntersection`,void 0),e([r()],d.prototype,`_interactiveHandle`,void 0),d=e([i(`esri.views.3d.analysis.LineOfSight.LineOfSightObserverPlugin`)],d);function f(e){return!!e&&u in e}function p(e={}){return{uniqueId:Symbol(`line-of-sight-observer-plugin`),kind:[`vertex`],geometryType:`point`,hidden:!0,localizationKey:`leaf-point-segment`,icon:`point`,create:()=>new d(e)}}export{d as LineOfSightObserverPlugin,p as createLineOfSightObserverPluginConfiguration,f as isLineOfSightObserverPlugin,u as lineOfSightObserverPluginMarker};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../analysis/LineOfSightAnalysisTarget.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{watch as r,sync as i}from"../../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{updateLineOfSightItemFromIntersection as s,updateLineOfSightItemFromAuthoredPoint as c,convertLineOfSightElevationMode as l}from"./LineOfSightAuthoringUtils.js";import{lineOfSightPlacementLeafPluginMarker as u}from"./LineOfSightPlacementLeafPlugin.js";import{LineOfSightRayIntersector as d}from"./LineOfSightRayIntersector.js";import{PluginBase as f}from"../../../draw/plugins/PluginBase.js";var p,m;const h=Symbol(`line-of-sight-target-vertex`),g=Symbol(`line-of-sight-target-plugin-marker`);let _=class extends f{constructor(){super(...arguments),this[p]=!0,this[m]=!0,this.target=null,this.defaultCaptureMode=`capture-always`,this.inputMapPosition=null,this.preservedIntersection=null,this._interactiveHandle=null,this._intersector=null,this._changingElevationMode=!1}static{p=g,m=u}initialize(){this._intersector=new d({view:this.view})}destroy(){this._intersector=n(this._intersector)}start(e){super.start(e),this.preservedIntersection=null;let{positionOfLastUserInput:a,session:o}=e,l=this.defaultCaptureMode===`grabbable-object`?this.inputMapPosition??this._interactiveHandle?.outputMapPosition??a:this.inputMapPosition??a;l&&(this.defaultCaptureMode===`grabbable-object`||!this._interactiveHandle)&&o.appendOrReplacePoint(h,l);let u=this.defaultCaptureMode===`capture-always`&&l!=null;this._interactiveHandle&&this._clearCursorTarget(),this._interactiveHandle||(this._interactiveHandle=e.createInteractiveHandle({defaultCaptureMode:this.defaultCaptureMode,inputMapPosition:this.defaultCaptureMode===`grabbable-object`?l??void 0:void 0},{elevationFieldProperties:{unlockOnVertexPlacement:!0}}),this.addHandles(r(()=>[this._interactiveHandle?.outputMapPosition,this.getElevationInfo()],([e,r])=>{if(!e||this._isComplete||this._changingElevationMode)return;let i=this.analysisViewData.cursorTarget??new t,a={elevationInfo:r},o=this._interactiveHandle?.screenPosition,l=o&&this._intersector?this._intersector.getScreenPointIntersection(o):null;if(this._session?.appendOrReplacePoint(h,e),u){u=!1,this._clearCursorTarget();return}if(l!=null){this.analysisViewData.cursorTarget=i,s(this.view,i,l,{...a,snappedMapPoint:e});return}if(o!=null&&this.preservedIntersection!=null){this.analysisViewData.cursorTarget=i,s(this.view,i,this.preservedIntersection,{...a,snappedMapPoint:e});return}if(o!=null){this.analysisViewData.cursorTarget=n(this.analysisViewData.cursorTarget);return}if(!this._intersector||!c(this.view,i,this._intersector,e,{...a,preservedIntersection:this.preservedIntersection})){this.analysisViewData.cursorTarget=n(this.analysisViewData.cursorTarget);return}this.analysisViewData.cursorTarget=i},i),this._ownHandlesKey))}changeElevationMode(e,t,n){let r=this.analysisViewData.cursorTarget,i=r?.position,a=i?l({view:this.view,point:i,sourceElevationInfo:r.elevationInfo,mode:e,preserveZ:t}):null;this._changingElevationMode=!0;try{n();let e=this._interactiveHandle?.outputMapPosition;e&&this._session?.appendOrReplacePoint(h,e),r&&a&&(r.position=a.position,r.elevationInfo=a.elevationInfo)}finally{this._changingElevationMode=!1}}complete(){this._clearCursorTarget(),super.complete()}cancel(){this._clearCursorTarget()}_clearCursorTarget(){this.analysisViewData.cursorTarget=n(this.analysisViewData.cursorTarget)}};e([a({constructOnly:!0})],_.prototype,`analysis`,void 0),e([a({constructOnly:!0})],_.prototype,`analysisViewData`,void 0),e([a({constructOnly:!0})],_.prototype,`view`,void 0),e([a({constructOnly:!0})],_.prototype,`target`,void 0),e([a({constructOnly:!0})],_.prototype,`getElevationInfo`,void 0),e([a()],_.prototype,`defaultCaptureMode`,void 0),e([a()],_.prototype,`inputMapPosition`,void 0),e([a()],_.prototype,`preservedIntersection`,void 0),e([a()],_.prototype,`_interactiveHandle`,void 0),e([a()],_.prototype,`_intersector`,void 0),_=e([o(`esri.views.3d.analysis.LineOfSight.LineOfSightTargetPlugin`)],_);function v(e){return!!e&&g in e}function y(e){return{uniqueId:Symbol(`line-of-sight-target-plugin`),kind:[`vertex`],geometryType:`point`,hidden:!0,localizationKey:`leaf-point-segment`,icon:`point`,create:()=>new _(e)}}export{_ as LineOfSightTargetPlugin,y as createLineOfSightTargetPluginConfiguration,v as isLineOfSightTargetPlugin,g as lineOfSightTargetPluginMarker};
2
+ import{__decorate as e}from"tslib";import t from"../../../../analysis/LineOfSightAnalysisTarget.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{watch as r,sync as i}from"../../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{updateLineOfSightItemFromIntersection as s,updateLineOfSightItemFromAuthoredPoint as c,convertLineOfSightElevationMode as l}from"./LineOfSightAuthoringUtils.js";import{lineOfSightPlacementLeafPluginMarker as u}from"./LineOfSightPlacementLeafPlugin.js";import{LineOfSightRayIntersector as d}from"./LineOfSightRayIntersector.js";import{PluginBase as f}from"../../../draw/plugins/PluginBase.js";var p,m;const h=Symbol(`line-of-sight-target-vertex`),g=Symbol(`line-of-sight-target-plugin-marker`);let _=class extends f{constructor(){super(...arguments),this[p]=!0,this[m]=!0,this.target=null,this.defaultCaptureMode=`capture-always`,this.inputMapPosition=null,this.preservedIntersection=null,this._interactiveHandle=null,this._intersector=null,this._changingElevationMode=!1}static{p=g,m=u}initialize(){this._intersector=new d({view:this.view})}destroy(){this._intersector=n(this._intersector)}start(e){super.start(e),this.preservedIntersection=null;let{positionOfLastUserInput:a,session:o}=e,l=this.defaultCaptureMode===`grabbable-object`?this.inputMapPosition??this._interactiveHandle?.outputMapPosition??a:this.inputMapPosition??a;l&&(this.defaultCaptureMode===`grabbable-object`||!this._interactiveHandle)&&o.appendOrReplacePoint(h,l);let u=this.defaultCaptureMode===`capture-always`&&l!=null;this._interactiveHandle&&this._clearCursorTarget(),this._interactiveHandle||(this._interactiveHandle=e.createInteractiveHandle({defaultCaptureMode:this.defaultCaptureMode,inputMapPosition:this.defaultCaptureMode===`grabbable-object`?l??void 0:void 0}),this.addHandles(r(()=>[this._interactiveHandle?.outputMapPosition,this.getElevationInfo()],([e,r])=>{if(!e||this._isComplete||this._changingElevationMode)return;let i=this.analysisViewData.cursorTarget??new t,a={elevationInfo:r},o=this._interactiveHandle?.screenPosition,l=o&&this._intersector?this._intersector.getScreenPointIntersection(o):null;if(this._session?.appendOrReplacePoint(h,e),u){u=!1,this._clearCursorTarget();return}if(l!=null){this.analysisViewData.cursorTarget=i,s(this.view,i,l,{...a,snappedMapPoint:e});return}if(o!=null&&this.preservedIntersection!=null){this.analysisViewData.cursorTarget=i,s(this.view,i,this.preservedIntersection,{...a,snappedMapPoint:e});return}if(o!=null){this.analysisViewData.cursorTarget=n(this.analysisViewData.cursorTarget);return}if(!this._intersector||!c(this.view,i,this._intersector,e,{...a,preservedIntersection:this.preservedIntersection})){this.analysisViewData.cursorTarget=n(this.analysisViewData.cursorTarget);return}this.analysisViewData.cursorTarget=i},i),this._ownHandlesKey))}changeElevationMode(e,t,n){let r=this.analysisViewData.cursorTarget,i=r?.position,a=i?l({view:this.view,point:i,sourceElevationInfo:r.elevationInfo,mode:e,preserveZ:t}):null;this._changingElevationMode=!0;try{n();let e=this._interactiveHandle?.outputMapPosition;e&&this._session?.appendOrReplacePoint(h,e),r&&a&&(r.position=a.position,r.elevationInfo=a.elevationInfo)}finally{this._changingElevationMode=!1}}complete(){this._clearCursorTarget(),super.complete()}cancel(){this._clearCursorTarget()}_clearCursorTarget(){this.analysisViewData.cursorTarget=n(this.analysisViewData.cursorTarget)}};e([a({constructOnly:!0})],_.prototype,`analysis`,void 0),e([a({constructOnly:!0})],_.prototype,`analysisViewData`,void 0),e([a({constructOnly:!0})],_.prototype,`view`,void 0),e([a({constructOnly:!0})],_.prototype,`target`,void 0),e([a({constructOnly:!0})],_.prototype,`getElevationInfo`,void 0),e([a()],_.prototype,`defaultCaptureMode`,void 0),e([a()],_.prototype,`inputMapPosition`,void 0),e([a()],_.prototype,`preservedIntersection`,void 0),e([a()],_.prototype,`_interactiveHandle`,void 0),e([a()],_.prototype,`_intersector`,void 0),_=e([o(`esri.views.3d.analysis.LineOfSight.LineOfSightTargetPlugin`)],_);function v(e){return!!e&&g in e}function y(e){return{uniqueId:Symbol(`line-of-sight-target-plugin`),kind:[`vertex`],geometryType:`point`,hidden:!0,localizationKey:`leaf-point-segment`,icon:`point`,create:()=>new _(e)}}export{_ as LineOfSightTargetPlugin,y as createLineOfSightTargetPluginConfiguration,v as isLineOfSightTargetPlugin,g as lineOfSightTargetPluginMarker};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../../core/Handles.js";import{handlesGroup as t}from"../../../../core/handleUtils.js";import{deg2rad as n,clamp as r}from"../../../../core/mathUtils.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{watch as a,initial as o}from"../../../../core/reactiveUtils.js";import{fromYRotation as s,fromXRotation as c,fromScaling as l,fromZRotation as u,fromRotation as d,multiply as f}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as m,sub as h,scale as g}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _,fromValues as v}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{f as y}from"../../../../chunks/boundedPlane.js";import{viewshedToolManipulatorConfiguration as b}from"./ViewshedConfiguration.js";import{screenToCircleAngle as x,getViewshedRotationMatrix as S}from"./viewshedToolUtils.js";import{Manipulator3D as C}from"../../interactive/Manipulator3D.js";import{RenderObject as w}from"../../interactive/RenderObject.js";import{InteractiveManipulation as T}from"../../interactive/editingTools/manipulations/InteractiveManipulation.js";import{createPolylineGeometry as E}from"../../webgl-engine/lib/GeometryUtil.js";import{assert as D}from"../../webgl-engine/lib/Util.js";import{RibbonLineMaterial as O}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createManipulatorDragEventPipeline as k}from"../../../interactive/dragEventPipeline.js";class A extends T{constructor(t){super(),this._handles=new e,this._tool=t.tool,this._view=t.view,this._focusedArcMaterial=this._createArcMaterial(!0),this._unfocusedArcMaterial=this._createArcMaterial(!1),this._createManipulators(),this.forEachManipulator(e=>this._tool.manipulators.add(e))}destroy(){this._handles=i(this._handles),this.forEachManipulator(e=>{this._tool.manipulators.remove(e),e.destroy()}),this._tool=null,this._view=null,this._manipulators=null}createDragPipeline(e,n){let r=Object.values(this._manipulators);return t(r.map(({manipulator:t,side:r})=>k(t,(t,i,a,o,s)=>{let c=L(r,n),l=i.next(e=>({...e,manipulatorType:2,side:r}));e(t,x(l,this._view,c,n),a)})))}updateManipulatorsTransform(e){e.arcCentersPoints(H),this._forEachManipulatorInfo(t=>this._updateArcManipulatorTransform(t,e,H[t.side]))}updateManipulatorVisuals(e){this._forEachManipulatorInfo(t=>this._updateArcManipulatorVisuals(t,e))}_updateArcManipulatorVisuals({manipulator:e,side:t},n){let r=[];if(n!=null){let[i,a]=j(t,n,this._unfocusedArcMaterial);r.push(new w(i,1),new w(i.instantiate({material:this._focusedArcMaterial}),2)),e.collisionType={type:`line`,paths:[a]}}e.renderObjects=r,e.radius=b.collisionRadius}_updateArcManipulatorTransform({manipulator:e,side:t},r,i){let a=r.horizontalFieldOfView,o=n(r.verticalFieldOfView/2),h=n(a/2),g=F(t);e.renderLocation=i;let _=p(),v=e=>{f(_,e,_)};v(s(z,n(-90))),g||v(c(z,o));let y=r.farDistanceRenderSpace;v(l(z,m(B,y,y,y))),v(u(z,P(t))),v(S(r,z));let b,x;g?(b=h,x=r.tiltedUpVector):(x=r.rightVector,b=o),b*=t===`right`||t===`bottom`?-1:1;let C=d(z,b,x);C!=null&&v(C),e.modelTransform=_}_createManipulators(){let e=this._createArcManipulator(`left`),t=this._createArcManipulator(`right`),n=this._createArcManipulator(`top`),r=this._createArcManipulator(`bottom`);this._manipulators={left:e,right:t,top:n,bottom:r},[[r.manipulator,n.manipulator],[e.manipulator,t.manipulator]].forEach(([e,t])=>{e.metadata={pairedManipulator:t},t.metadata={pairedManipulator:e}})}_createArcManipulator(e){let t=new C({view:this._view,autoScaleRenderObjects:!1,worldSized:!0}),n={manipulator:t,side:e};return this._updateArcManipulatorVisuals(n),this._handles.add(t.events.on([`focus-changed`,`grab-changed`],e=>{let n=t.metadata?.pairedManipulator;n!=null&&(n.hovering!==t.hovering&&(n.hovering=t.hovering),n.grabbing!==t.grabbing&&(n.grabbing=t.grabbing))})),n}_createArcMaterial(e){let t=b.getFovArcWidth(e),n=new O({renderOccluded:4,isDecoration:!0,width:t},this._view.state.isGlobal);return this._handles.add(a(()=>this._view.effectiveTheme.accentColor.toUnitRGBA(),e=>n.setParameters({color:e}),o)),n}forEachManipulator(e){Object.values(this._manipulators).forEach(({manipulator:t})=>e(t,2))}_forEachManipulatorInfo(e){Object.values(this._manipulators).forEach(t=>e(t))}get test(){return{manipulators:this._manipulators}}}function j(e,t,i){let{horizontalFieldOfView:a,verticalFieldOfView:o}=t,s=F(e),c=(s?o:a)/2,l=n(r(c,0,15)),u=s?1:Math.max(Math.sin(n(90-o/2)),.1),d=M(-l/2,l/2,u);return[E(i,d),d]}function M(e,t,n,r=10){D(r>1,`createArcPolylineGeometry() needs at least 2 for numVertices`);let i=t-e;if(i<=0||n<=0)return[v(0,0,.01),v(0,0,-.01)];let a=[],o=i/r;for(let i=0;i<r;i++){let s=e+i*o;i===r-1&&(s=t);let c=Math.cos(s)*n,l=Math.sin(s)*n,u=v(c-n,0,l);a.push(u)}return a}function N(e){switch(e){case`left`:return 0;case`bottom`:return 1;case`right`:return 2;case`top`:return 3}}function P(e){return N(e)*R}function F(e){return e===`left`||e===`right`}function I(e){return e===`left`?`right`:e===`right`?`left`:e===`top`?`bottom`:`top`}function L(e,t){let{elevationAlignedObserverRenderSpace:n,elevationAlignedTargetRenderSpace:r,tiltedUpVector:i,rightVector:a,farDistanceRenderSpace:o}=t,s=h(B,r,n),c=F(e)?a:i,l=g(V,c,o);return y(n,s,l)}const R=Math.PI/2,z=p(),B=_(),V=_(),H={top:_(),bottom:_(),left:_(),right:_()};export{A as ViewshedFieldOfViewManipulation,M as createArcPolylineVertices,I as flipSide,F as isSideHorizontal,P as sideToRad};
2
+ import e from"../../../../core/Handles.js";import{handlesGroup as t}from"../../../../core/handleUtils.js";import{deg2rad as n,clamp as r}from"../../../../core/mathUtils.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{watch as a,initial as o}from"../../../../core/reactiveUtils.js";import{fromYRotation as s,fromXRotation as c,fromScaling as l,fromZRotation as u,fromRotation as d,multiply as f}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as m,sub as h,scale as g}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _,fromValues as v}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{f as y}from"../../../../chunks/boundedPlane.js";import{viewshedToolManipulatorConfiguration as b}from"./ViewshedConfiguration.js";import{screenToCircleAngle as x,getViewshedRotationMatrix as S}from"./viewshedToolUtils.js";import{Manipulator3D as C}from"../../interactive/Manipulator3D.js";import{RenderObject as w}from"../../interactive/RenderObject.js";import{InteractiveManipulation as T}from"../../interactive/editingTools/manipulations/InteractiveManipulation.js";import{createPolylineGeometry as E}from"../../webgl-engine/lib/GeometryUtil.js";import{assert as D}from"../../webgl-engine/lib/Util.js";import{RibbonLineMaterial as O}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createManipulatorDragEventPipeline as k}from"../../../interactive/dragEventPipeline.js";class A extends T{constructor(t){super(),this._handles=new e,this._tool=t.tool,this._view=t.view,this._focusedArcMaterial=this._createArcMaterial(!0),this._unfocusedArcMaterial=this._createArcMaterial(!1),this._createManipulators(),this.forEachManipulator(e=>this._tool.manipulators.add(e))}destroy(){this._handles=i(this._handles),this.forEachManipulator(e=>{this._tool.manipulators.remove(e),e.destroy()}),this._tool=null,this._view=null,this._manipulators=null}createDragPipeline(e,n){let r=Object.values(this._manipulators);return t(r.map(({manipulator:t,side:r})=>k(t,(t,i,a,o,s)=>{let c=L(r,n),l=i.next(e=>({...e,manipulatorType:2,side:r}));e(t,x(l,this._view,c,n),a)})))}updateManipulatorsTransform(e){e.arcCentersPoints(H),this._forEachManipulatorInfo(t=>this._updateArcManipulatorTransform(t,e,H[t.side]))}updateManipulatorVisuals(e){this._forEachManipulatorInfo(t=>this._updateArcManipulatorVisuals(t,e))}_updateArcManipulatorVisuals({manipulator:e,side:t},n){let r=[];if(n!=null){let[i,a]=j(t,n,this._unfocusedArcMaterial);r.push(new w(i,1),new w(i.instantiate({material:this._focusedArcMaterial}),2)),e.collisionType={type:`line`,paths:[a]}}e.renderObjects=r,e.radius=b.collisionRadius}_updateArcManipulatorTransform({manipulator:e,side:t},r,i){let a=r.horizontalFieldOfView,o=n(r.verticalFieldOfView/2),h=n(a/2),g=F(t);e.renderLocation=i;let _=p(),v=e=>{f(_,e,_)};v(s(z,n(-90))),g||v(c(z,o));let y=r.farDistanceRenderSpace;v(l(z,m(B,y,y,y))),v(u(z,P(t))),v(S(r,z));let b,x;g?(b=h,x=r.tiltedUpVector):(x=r.rightVector,b=o),b*=t===`right`||t===`bottom`?-1:1;let C=d(z,b,x);C!=null&&v(C),e.modelTransform=_}_createManipulators(){let e=this._createArcManipulator(`left`),t=this._createArcManipulator(`right`),n=this._createArcManipulator(`top`),r=this._createArcManipulator(`bottom`);this._manipulators={left:e,right:t,top:n,bottom:r},[[r.manipulator,n.manipulator],[e.manipulator,t.manipulator]].forEach(([e,t])=>{e.metadata={pairedManipulator:t},t.metadata={pairedManipulator:e}})}_createArcManipulator(e){let t=new C({view:this._view,autoScaleRenderObjects:!1,worldSized:!0}),n={manipulator:t,side:e};return this._updateArcManipulatorVisuals(n),this._handles.add(t.events.on([`focus-changed`,`grab-changed`],e=>{let n=t.metadata?.pairedManipulator;n!=null&&(n.hovering!==t.hovering&&(n.hovering=t.hovering),n.grabbing!==t.grabbing&&(n.grabbing=t.grabbing))})),n}_createArcMaterial(e){let t=b.getFovArcWidth(e),n=new O({renderOccluded:4,isDecoration:!0,width:t},this._view);return this._handles.add(a(()=>this._view.effectiveTheme.accentColor.toUnitRGBA(),e=>n.setParameters({color:e}),o)),n}forEachManipulator(e){Object.values(this._manipulators).forEach(({manipulator:t})=>e(t,2))}_forEachManipulatorInfo(e){Object.values(this._manipulators).forEach(t=>e(t))}get test(){return{manipulators:this._manipulators}}}function j(e,t,i){let{horizontalFieldOfView:a,verticalFieldOfView:o}=t,s=F(e),c=(s?o:a)/2,l=n(r(c,0,15)),u=s?1:Math.max(Math.sin(n(90-o/2)),.1),d=M(-l/2,l/2,u);return[E(i,d),d]}function M(e,t,n,r=10){D(r>1,`createArcPolylineGeometry() needs at least 2 for numVertices`);let i=t-e;if(i<=0||n<=0)return[v(0,0,.01),v(0,0,-.01)];let a=[],o=i/r;for(let i=0;i<r;i++){let s=e+i*o;i===r-1&&(s=t);let c=Math.cos(s)*n,l=Math.sin(s)*n,u=v(c-n,0,l);a.push(u)}return a}function N(e){switch(e){case`left`:return 0;case`bottom`:return 1;case`right`:return 2;case`top`:return 3}}function P(e){return N(e)*R}function F(e){return e===`left`||e===`right`}function I(e){return e===`left`?`right`:e===`right`?`left`:e===`top`?`bottom`:`top`}function L(e,t){let{elevationAlignedObserverRenderSpace:n,elevationAlignedTargetRenderSpace:r,tiltedUpVector:i,rightVector:a,farDistanceRenderSpace:o}=t,s=h(B,r,n),c=F(e)?a:i,l=g(V,c,o);return y(n,s,l)}const R=Math.PI/2,z=p(),B=_(),V=_(),H={top:_(),bottom:_(),left:_(),right:_()};export{A as ViewshedFieldOfViewManipulation,M as createArcPolylineVertices,I as flipSide,F as isSideHorizontal,P as sideToRad};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{watch as t,sync as n}from"../../../../core/reactiveUtils.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{PluginBase as a}from"../../../draw/plugins/PluginBase.js";var o;const s=Symbol(`viewshed-placement-point-plugin-marker`);let c=class extends a{static{o=s}constructor(e){super(e),this[o]=!0,this.defaultCaptureMode=`capture-always`,this.inputMapPosition=null,this.outputMapPosition=null,this.screenPosition=null,this.hasCommittedPoint=!1,this._vertexId=Symbol(`viewshed-placement-point-vertex`)}start(e){super.start(e);let{positionOfLastUserInput:t,session:n}=e,r=this._getInitialMapPoint(t);r&&(this.defaultCaptureMode===`grabbable-object`||!this._interactiveHandle)&&(n.appendOrReplacePoint(this._vertexId,r),this.outputMapPosition=r.clone()),this._ensureInteractiveHandle(e,r)}completeStep(){this.hasCommittedPoint=!0,this._context?.requestComplete()}_ensureInteractiveHandle(e,r){if(this._interactiveHandle)return;let{defaultCaptureMode:i}=this;this._interactiveHandle=e.createInteractiveHandle({defaultCaptureMode:i,inputMapPosition:i===`grabbable-object`?r:void 0},{disableDefaultXYFields:this.step===`target`,elevationFieldProperties:{unlockOnVertexPlacement:!0}}),this.addHandles(t(()=>{let e=this._interactiveHandle;return{outputMapPosition:e?.outputMapPosition,screenPosition:e?.screenPosition}},({outputMapPosition:e,screenPosition:t})=>{this.outputMapPosition=e?.clone(),this.screenPosition=t,e&&!this._isComplete&&this._session?.appendOrReplacePoint(this._vertexId,e)},n),this._ownHandlesKey)}_getInitialMapPoint(e){return this.defaultCaptureMode===`grabbable-object`?this.inputMapPosition??this._interactiveHandle?.outputMapPosition??e:this.inputMapPosition??e}};e([r({constructOnly:!0})],c.prototype,`step`,void 0),e([r()],c.prototype,`defaultCaptureMode`,void 0),e([r()],c.prototype,`inputMapPosition`,void 0),e([r()],c.prototype,`outputMapPosition`,void 0),e([r()],c.prototype,`screenPosition`,void 0),e([r()],c.prototype,`hasCommittedPoint`,void 0),e([r()],c.prototype,`_interactiveHandle`,void 0),c=e([i(`esri.views.3d.analysis.Viewshed.ViewshedPlacementPointPlugin`)],c);function l(e){return{uniqueId:Symbol(`viewshed-${e}-plugin`),kind:[`vertex`],geometryType:`point`,hidden:!0,localizationKey:`leaf-point-segment`,icon:`point`,create:()=>new c({step:e})}}export{c as ViewshedPlacementPointPlugin,l as createViewshedPlacementPointPluginConfiguration};
2
+ import{__decorate as e}from"tslib";import{watch as t,sync as n}from"../../../../core/reactiveUtils.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{PluginBase as a}from"../../../draw/plugins/PluginBase.js";var o;const s=Symbol(`viewshed-placement-point-plugin-marker`);let c=class extends a{static{o=s}constructor(e){super(e),this[o]=!0,this.defaultCaptureMode=`capture-always`,this.inputMapPosition=null,this.outputMapPosition=null,this.screenPosition=null,this.hasCommittedPoint=!1,this._vertexId=Symbol(`viewshed-placement-point-vertex`)}start(e){super.start(e);let{positionOfLastUserInput:t,session:n}=e,r=this._getInitialMapPoint(t);r&&(this.defaultCaptureMode===`grabbable-object`||!this._interactiveHandle)&&(n.appendOrReplacePoint(this._vertexId,r),this.outputMapPosition=r.clone()),this._ensureInteractiveHandle(e,r)}completeStep(){this.hasCommittedPoint=!0,this._context?.requestComplete()}_ensureInteractiveHandle(e,r){if(this._interactiveHandle)return;let{defaultCaptureMode:i}=this;this._interactiveHandle=e.createInteractiveHandle({defaultCaptureMode:i,inputMapPosition:i===`grabbable-object`?r:void 0},{disableDefaultXYFields:this.step===`target`}),this.addHandles(t(()=>{let e=this._interactiveHandle;return{outputMapPosition:e?.outputMapPosition,screenPosition:e?.screenPosition}},({outputMapPosition:e,screenPosition:t})=>{this.outputMapPosition=e?.clone(),this.screenPosition=t,e&&!this._isComplete&&this._session?.appendOrReplacePoint(this._vertexId,e)},n),this._ownHandlesKey)}_getInitialMapPoint(e){return this.defaultCaptureMode===`grabbable-object`?this.inputMapPosition??this._interactiveHandle?.outputMapPosition??e:this.inputMapPosition??e}};e([r({constructOnly:!0})],c.prototype,`step`,void 0),e([r()],c.prototype,`defaultCaptureMode`,void 0),e([r()],c.prototype,`inputMapPosition`,void 0),e([r()],c.prototype,`outputMapPosition`,void 0),e([r()],c.prototype,`screenPosition`,void 0),e([r()],c.prototype,`hasCommittedPoint`,void 0),e([r()],c.prototype,`_interactiveHandle`,void 0),c=e([i(`esri.views.3d.analysis.Viewshed.ViewshedPlacementPointPlugin`)],c);function l(e){return{uniqueId:Symbol(`viewshed-${e}-plugin`),kind:[`vertex`],geometryType:`point`,hidden:!0,localizationKey:`leaf-point-segment`,icon:`point`,create:()=>new c({step:e})}}export{c as ViewshedPlacementPointPlugin,l as createViewshedPlacementPointPluginConfiguration};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{getFeatureId as t,updatePointsFromFeatureReference as n}from"../../../analysis/featureReferenceUtils.js";import"../../../core/has.js";import r from"../../../core/Logger.js";import{mapCollection as i}from"../../../core/mapCollectionUtils.js";import{abortMaybe as a,destroyMaybe as o}from"../../../core/maybe.js";import{watch as s,initial as c,when as l,syncAndInitial as u}from"../../../core/reactiveUtils.js";import{property as d,subclass as f}from"../../../core/accessorSupport/decorators.js";import{copy as p,exactEquals as m}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{canProjectWithoutEngine as g,isLoaded as _}from"../../../geometry/projectionUtils.js";import v from"./AnalysisView3D.js";import{logFailedGeometryProjectionError as y}from"./support/projectionUtils.js";import{registerAnalysisView as b,unselectViewshedInOtherAnalysisViews as x}from"./Viewshed/analysisViewRegister.js";import{ViewshedComputedData as S}from"./Viewshed/ViewshedComputedData.js";import C from"./Viewshed/ViewshedTool.js";import{ViewshedVisualization as w}from"./Viewshed/ViewshedVisualization.js";import{createElevationUpdateHandle as T}from"../support/elevationUpdateUtils.js";import{Intersector as E}from"../webgl-engine/lib/Intersector.js";import{Viewshed as D}from"../webgl-engine/lib/Viewshed.js";let O=class extends v{constructor(e){super(e),this.type=`viewshed-view-3d`,this.analysis=null,this._tool=null,this._selectedViewshed=null,this.viewshedComputedDataHandles=null,this.userOperation=null,this._viewshedRenderNode=null,this._intersector=null}get visible(){return super.visible}set visible(e){super.visible=e}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get toolActive(){return this._tool?.active??!1}get toolCreating(){return this._tool?.creating??!1}get stagedViewshed(){return this._tool?.stagedViewshed}get selectedViewshed(){return this._selectedViewshed}set selectedViewshed(e){let t=e!=null&&this.analysis.viewsheds.includes(e)?e:null;this._unselectOtherViewsheds(t),this._selectedViewshed=t}get selectedViewshedComputedData(){return this._tool?.selectedViewshedComputedData}get updating(){return!!this._tool?.updating}get _isDecoration(){return!this.parent}initialize(){let e=this.view;this.addHandles(b(e,this)),this._viewshedRenderNode=new D({view:e,selectedViewshed:()=>this.selectedViewshed??this.stagedViewshed,isDecoration:this._isDecoration}),this._intersector=new E(this.view.state.viewingMode),this._intersector.options.hud=!1,this._intersector.options.store=0,this.viewshedComputedDataHandles=i(()=>this.analysis.viewsheds,t=>{let n=new S({view:e,viewshed:t}),i=Symbol();return this.addHandles([s(()=>({valid:n.valid,canProject:g(n.observer?.spatialReference,this.view.spatialReference)||_()}),({valid:e,canProject:t},i)=>{this.visible&&(e&&t?this._addViewshedsToRenderer(n):i?.valid&&i?.canProject&&this._removeViewshedsFromRenderer(n),t||y(this.analysis,n.observer.spatialReference,r.getLogger(this)))},c),T({view:e,geometry:n.observer,onElevationChanges:()=>n.onElevationChange()}),s(()=>[e.state.camera,e.slice.plane,n.elevationAlignedObserverRenderSpace,n.elevationAlignedTargetRenderSpace,n.verticalFieldOfView,n.horizontalFieldOfView,n.feature],()=>{this._updateObserverFromFeature(e,n)},c)],i),{viewshedComputedData:n,remove:()=>{this.selectedViewshed===n.viewshed&&(this.selectedViewshed=null),this.removeHandles(i),this._removeViewshedsFromRenderer(n),n.destroy()}}}),this._visualization=new w({view:e,analysisViewData:this,isDecoration:this._isDecoration}),this._tool=new C({analysis:this.analysis,analysisViewData:this,view:e}),this.addHandles([s(()=>this.visible,e=>{let t=this.viewshedComputedDataHandles;if(t==null)return;e||(this.selectedViewshed=null);let n=t.items.values().map(e=>e.viewshedComputedData).filter(e=>e.valid).toArray();e?this._addViewshedsToRenderer(n):this._removeViewshedsFromRenderer(n)}),l(()=>this.interactive,()=>this._unselectOtherViewsheds(this.selectedViewshed),u)])}destroy(){this.userOperation=a(this.userOperation),this._tool=o(this._tool),this._visualization=o(this._visualization);let e=this.viewshedComputedDataHandles;e!=null&&this._removeViewshedsFromRenderer(e.items.map(e=>e.viewshedComputedData))}async createViewsheds(e){return this._tool.place(`multiple`,e)}place(e){return this._tool.place(`single`,e)}_addViewshedsToRenderer(e){this._viewshedRenderNode.updateViewsheds({adds:e})}_removeViewshedsFromRenderer(e){this._viewshedRenderNode.updateViewsheds({removes:e})}_updateObserverFromFeature(e,r){let i=r.elevationAlignedObserverRenderSpace,a=r.elevationAlignedTargetRenderSpace,o=p(h(),i),s={observer:i,observerSurfaceNormal:null,observerAdjusted:o,observerFeatureId:t(r.feature),target:a,targetSurfaceNormal:null,targetAdjusted:p(h(),a),targetFeatureId:null};n(e,this._intersector,s,e=>Math.min(e,.05*r.farDistanceRenderSpace)),r.observerRenderSpaceOverride=m(o,i)?null:o}_unselectOtherViewsheds(e){e!=null&&x(this.view,this)}get test(){}};e([d({readOnly:!0})],O.prototype,`type`,void 0),e([d({constructOnly:!0,nonNullable:!0})],O.prototype,`analysis`,void 0),e([d()],O.prototype,`_tool`,void 0),e([d()],O.prototype,`toolActive`,null),e([d()],O.prototype,`toolCreating`,null),e([d()],O.prototype,`stagedViewshed`,null),e([d()],O.prototype,`_selectedViewshed`,void 0),e([d()],O.prototype,`selectedViewshed`,null),e([d()],O.prototype,`selectedViewshedComputedData`,null),e([d()],O.prototype,`viewshedComputedDataHandles`,void 0),e([d()],O.prototype,`userOperation`,void 0),e([d()],O.prototype,`updating`,null),e([d()],O.prototype,`_visualization`,void 0),e([d()],O.prototype,`_viewshedRenderNode`,void 0),O=e([f(`esri.views.3d.analysis.ViewshedAnalysisView3D`)],O);const k=O;export{k as default};
2
+ import{__decorate as e}from"tslib";import{getFeatureId as t,updatePointsFromFeatureReference as n}from"../../../analysis/featureReferenceUtils.js";import"../../../core/has.js";import r from"../../../core/Logger.js";import{mapCollection as i}from"../../../core/mapCollectionUtils.js";import{abortMaybe as a,destroyMaybe as o}from"../../../core/maybe.js";import{watch as s,initial as c,when as l,syncAndInitial as u}from"../../../core/reactiveUtils.js";import{property as d,subclass as f}from"../../../core/accessorSupport/decorators.js";import{copy as p,exactEquals as m}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{canProjectWithoutEngine as g,isLoaded as _}from"../../../geometry/projectionUtils.js";import v from"./AnalysisView3D.js";import{logFailedGeometryProjectionError as y}from"./support/projectionUtils.js";import{registerAnalysisView as b,unselectViewshedInOtherAnalysisViews as x}from"./Viewshed/analysisViewRegister.js";import{ViewshedComputedData as S}from"./Viewshed/ViewshedComputedData.js";import C from"./Viewshed/ViewshedTool.js";import{ViewshedVisualization as w}from"./Viewshed/ViewshedVisualization.js";import{createElevationUpdateHandle as T}from"../support/elevationUpdateUtils.js";import{Intersector as E}from"../webgl-engine/lib/Intersector.js";import{Viewshed as D}from"../webgl-engine/lib/Viewshed.js";let O=class extends v{constructor(e){super(e),this.type=`viewshed-view-3d`,this.analysis=null,this._tool=null,this._selectedViewshed=null,this.viewshedComputedDataHandles=null,this.userOperation=null,this._viewshedRenderNode=null,this._intersector=null}get visible(){return super.visible}set visible(e){super.visible=e}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get toolActive(){return this._tool?.active??!1}get toolCreating(){return this._tool?.creating??!1}get stagedViewshed(){return this._tool?.stagedViewshed}get selectedViewshed(){return this._selectedViewshed}set selectedViewshed(e){let t=e!=null&&this.analysis.viewsheds.includes(e)?e:null;this._unselectOtherViewsheds(t),this._selectedViewshed=t}get selectedViewshedComputedData(){return this._tool?.selectedViewshedComputedData}get updating(){return!!this._tool?.updating}get _isDecoration(){return!this.parent}initialize(){let e=this.view;this.addHandles(b(e,this)),this._viewshedRenderNode=new D({view:e,selectedViewshed:()=>this.selectedViewshed??this.stagedViewshed,isDecoration:this._isDecoration}),this._intersector=new E(this.view.state.viewingMode),this._intersector.options.hud=!1,this._intersector.options.store=0,this.viewshedComputedDataHandles=i(()=>this.analysis.viewsheds,t=>{let n=new S({view:e,viewshed:t}),i=Symbol();return this.addHandles([s(()=>({valid:n.valid,canProject:g(n.observer?.spatialReference,this.view.spatialReference)||_()}),({valid:e,canProject:t},i)=>{this.visible&&(e&&t?this._addViewshedsToRenderer(n):i?.valid&&i?.canProject&&this._removeViewshedsFromRenderer(n),t||y(this.analysis,n.observer.spatialReference,r.getLogger(this)))},c),T({view:e,geometry:()=>n.observer,onElevationChanges:()=>n.onElevationChange()}),s(()=>[e.state.camera,e.slice.plane,n.elevationAlignedObserverRenderSpace,n.elevationAlignedTargetRenderSpace,n.verticalFieldOfView,n.horizontalFieldOfView,n.feature],()=>{this._updateObserverFromFeature(e,n)},c)],i),{viewshedComputedData:n,remove:()=>{this.selectedViewshed===n.viewshed&&(this.selectedViewshed=null),this.removeHandles(i),this._removeViewshedsFromRenderer(n),n.destroy()}}}),this._visualization=new w({view:e,analysisViewData:this,isDecoration:this._isDecoration}),this._tool=new C({analysis:this.analysis,analysisViewData:this,view:e}),this.addHandles([s(()=>this.visible,e=>{let t=this.viewshedComputedDataHandles;if(t==null)return;e||(this.selectedViewshed=null);let n=t.items.values().map(e=>e.viewshedComputedData).filter(e=>e.valid).toArray();e?this._addViewshedsToRenderer(n):this._removeViewshedsFromRenderer(n)}),l(()=>this.interactive,()=>this._unselectOtherViewsheds(this.selectedViewshed),u)])}destroy(){this.userOperation=a(this.userOperation),this._tool=o(this._tool),this._visualization=o(this._visualization);let e=this.viewshedComputedDataHandles;e!=null&&this._removeViewshedsFromRenderer(e.items.map(e=>e.viewshedComputedData))}async createViewsheds(e){return this._tool.place(`multiple`,e)}place(e){return this._tool.place(`single`,e)}_addViewshedsToRenderer(e){this._viewshedRenderNode.updateViewsheds({adds:e})}_removeViewshedsFromRenderer(e){this._viewshedRenderNode.updateViewsheds({removes:e})}_updateObserverFromFeature(e,r){let i=r.elevationAlignedObserverRenderSpace,a=r.elevationAlignedTargetRenderSpace,o=p(h(),i),s={observer:i,observerSurfaceNormal:null,observerAdjusted:o,observerFeatureId:t(r.feature),target:a,targetSurfaceNormal:null,targetAdjusted:p(h(),a),targetFeatureId:null};n(e,this._intersector,s,e=>Math.min(e,.05*r.farDistanceRenderSpace)),r.observerRenderSpaceOverride=m(o,i)?null:o}_unselectOtherViewsheds(e){e!=null&&x(this.view,this)}get test(){}};e([d({readOnly:!0})],O.prototype,`type`,void 0),e([d({constructOnly:!0,nonNullable:!0})],O.prototype,`analysis`,void 0),e([d()],O.prototype,`_tool`,void 0),e([d()],O.prototype,`toolActive`,null),e([d()],O.prototype,`toolCreating`,null),e([d()],O.prototype,`stagedViewshed`,null),e([d()],O.prototype,`_selectedViewshed`,void 0),e([d()],O.prototype,`selectedViewshed`,null),e([d()],O.prototype,`selectedViewshedComputedData`,null),e([d()],O.prototype,`viewshedComputedDataHandles`,void 0),e([d()],O.prototype,`userOperation`,void 0),e([d()],O.prototype,`updating`,null),e([d()],O.prototype,`_visualization`,void 0),e([d()],O.prototype,`_viewshedRenderNode`,void 0),O=e([f(`esri.views.3d.analysis.ViewshedAnalysisView3D`)],O);const k=O;export{k as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as n}from"../../../core/maybe.js";import{watch as r,initial as i,syncAndInitial as a}from"../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../core/accessorSupport/decorators.js";import{DoubleClickZoom as c}from"./handlers/DoubleClickZoom.js";import{DragRotate as l}from"./handlers/DragRotate.js";import{DragZoom as u}from"./handlers/DragZoom.js";import{DragZoomBox as d}from"./handlers/DragZoomBox.js";import{GamepadNavigation as f}from"./handlers/GamepadNavigation.js";import{KeyboardNavigation as p}from"./handlers/KeyboardNavigation.js";import{MouseWheelFov as m}from"./handlers/MouseWheelFov.js";import{MouseWheelZoom as h}from"./handlers/MouseWheelZoom.js";import{PinchAndPanNavigation as g}from"./handlers/PinchAndPanNavigation.js";import{PointerDownCancelAnimation as _}from"./handlers/PointerDownCancelAnimation.js";import{TwoFingerTilt as v}from"./handlers/TwoFingerTilt.js";import{GroundDoubleClickMove as y}from"./handlers/ground/GroundDoubleClickMove.js";import{GroundNavigation as b}from"./handlers/ground/GroundNavigation.js";import{BrowserEventSource as x}from"../../input/BrowserEventSource.js";import{InputManager as S,ViewEventPriorities as C}from"../../input/InputManager.js";import{PreventContextMenu as w}from"../../input/handlers/PreventContextMenu.js";import{PreventTouchSelection as T}from"../../input/handlers/PreventTouchSelection.js";import{getPointerActions as E}from"../../input/handlers/support.js";import{Drag as D}from"../../input/recognizers/Drag.js";import{ImmediateDoubleClick as O}from"../../input/recognizers/ImmediateDoubleClick.js";import{PointerClickHoldAndDrag as k}from"../../input/recognizers/PointerClickHoldAndDrag.js";import{SingleAndDoubleClick as A}from"../../input/recognizers/SingleAndDoubleClick.js";import{VerticalTwoFingerDrag as j}from"../../input/recognizers/VerticalTwoFingerDrag.js";const M=`modeDependentNavigation`;let N=class extends t{constructor(){super(...arguments),this.mode=`default`,this._keys={fov:`Shift`,pan:{left:`ArrowLeft`,right:`ArrowRight`,forward:`ArrowUp`,backward:`ArrowDown`,up:[`u`,`U`],down:[`j`,`J`]},lookAround:{headingLeft:[`a`,`A`],headingRight:[`d`,`D`],tiltUp:[`w`,`W`],tiltDown:[`s`,`S`]},modifier:[`b`,`B`],zoom:{zoomIn:[`+`,`=`],zoomOut:[`-`,`_`]},reset:{heading:[`n`,`N`],tilt:[`p`,`P`]},precisionPanModifier:`Alt`,coarsePanModifier:`Shift`},this._updateMode=({mode:e,dragPrimary:t,dragSecondary:n,dragTertiary:r})=>{e===`pro`&&(n=`zoom`,r=t===`pan`?`rotate`:`pan`);let i={dragPrimary:t,dragSecondary:n,dragTertiary:r};this._modeDragPan&&(this._modeDragPan.pointerActions=E(`pan`,i)),this._modeGroundNavigation&&(this._modeGroundNavigation.pointerActions=E(`pan`,i)),this._modeDragRotate&&(this._modeDragRotate.pointerActions=E(`rotate`,i)),this._modeGroundNavigationDragRotate&&(this._modeGroundNavigationDragRotate.pointerActions=E(`rotate`,i)),this._modeDragZoom&&(this._modeDragZoom.pointerActions=E(`zoom`,i))}}destroy(){this.disconnect()}get primaryDragAction(){return this.view.navigation.actionMap.dragPrimary}set primaryDragAction(e){let{actionMap:t}=this.view.navigation;t.dragPrimary=e,t.dragSecondary=e===`pan`?`rotate`:`pan`}get updating(){return!!this._inputManager?.updating}get latestPointerInfo(){return this._inputManager?.latestPointerInfo}get latestPenInfo(){return this._inputManager?.latestPenInfo}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}disconnect(){this.removeAllHandles(),this.view.viewEvents.disconnect(),this._modeDragPan=null,this._modeGroundNavigation=null,this._modeDragRotate=null,this._modeGroundNavigationDragRotate=null,this._modeDragZoom=null,this._modeKeyboardNavigation=null,this._inputManager=n(this._inputManager),this._source=n(this._source)}connect(){let e=this.view;this._source=new x(this.view.surface,e.input);let t=[new O,new k,new A,new D(this.view.navigation),new j],n=new S({eventSource:this._source,recognizers:t});this._inputManager=n,n.installHandlers(`prevent-context-menu`,[new w],C.INTERNAL),n.installHandlers(`prevent-touch-text-selection-gesture`,[new T(this.view)],C.INTERNAL),this._modeDragPan=new g(e,[`primary`]),this._modeDragRotate=new l(e,[`secondary`],0),this._modeDragZoom=new u(e,[`tertiary`],this._keys.fov),this._modeKeyboardNavigation=new p(e,this._keys);let o=[new _(e),new c(e),new f(e),new m(e,this._keys.fov),new h(e),new d(e),new l(e,[`primary`],1,this._keys.modifier),new b(e,[`secondary`],this._keys.modifier),this._modeDragRotate,this._modeDragZoom,this._modeDragPan,this._modeKeyboardNavigation,new v(e)];this._modeGroundNavigation=new b(e,[`primary`]),this._modeGroundNavigationDragRotate=new l(e,[`secondary`],1);let s=[this._modeGroundNavigation,new m(e,this._keys.fov),new b(e,[`tertiary`]),this._modeGroundNavigationDragRotate,this._modeKeyboardNavigation,new y(e)];this.view.viewEvents.connect(n),this.addHandles([r(()=>this.view.navigation.mode,e=>{switch(n.hasHandlers(M)&&n.uninstallHandlers(M),e.type){case`default`:n.installHandlers(M,o,C.INTERNAL);break;case`ground`:n.installHandlers(M,s,C.INTERNAL)}},{initial:!0}),r(()=>this.view.navigation?.browserTouchPanEnabled,e=>{this._source.browserTouchPanningEnabled=!e},i),r(()=>{let{actionMap:e}=this.view.navigation,{dragPrimary:t,dragSecondary:n,dragTertiary:r}=e;return{mode:this.mode,dragPrimary:t,dragSecondary:n,dragTertiary:r}},this._updateMode,a)])}isModifierKeyDown(e){return this._inputManager?.isModifierKeyDown(e)??!1}get test(){}};e([o()],N.prototype,`view`,void 0),e([o({type:[`default`,`pro`]})],N.prototype,`mode`,void 0),e([o({readOnly:!0})],N.prototype,`updating`,null),e([o()],N.prototype,`latestPointerInfo`,null),e([o()],N.prototype,`latestPenInfo`,null),e([o()],N.prototype,`multiTouchActive`,null),e([o()],N.prototype,`_inputManager`,void 0),N=e([s(`esri.views.3d.input.SceneInputManager`)],N);const P=N;export{P as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as n}from"../../../core/maybe.js";import{watch as r,initial as i,syncAndInitial as a}from"../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../core/accessorSupport/decorators.js";import{DoubleClickZoom as c}from"./handlers/DoubleClickZoom.js";import{DragRotate as l}from"./handlers/DragRotate.js";import{DragZoom as u}from"./handlers/DragZoom.js";import{DragZoomBox as d}from"./handlers/DragZoomBox.js";import{GamepadNavigation as f}from"./handlers/GamepadNavigation.js";import{KeyboardNavigation as p}from"./handlers/KeyboardNavigation.js";import{MouseWheelFov as m}from"./handlers/MouseWheelFov.js";import{MouseWheelZoom as h}from"./handlers/MouseWheelZoom.js";import{PinchAndPanNavigation as g}from"./handlers/PinchAndPanNavigation.js";import{PointerDownCancelAnimation as _}from"./handlers/PointerDownCancelAnimation.js";import{TwoFingerTilt as v}from"./handlers/TwoFingerTilt.js";import{GroundDoubleClickMove as y}from"./handlers/ground/GroundDoubleClickMove.js";import{GroundNavigation as b}from"./handlers/ground/GroundNavigation.js";import{BrowserEventSource as x}from"../../input/BrowserEventSource.js";import{InputManager as S,ViewEventPriorities as C}from"../../input/InputManager.js";import{PreventContextMenu as w}from"../../input/handlers/PreventContextMenu.js";import{PreventTouchSelection as T}from"../../input/handlers/PreventTouchSelection.js";import{getPointerActions as E}from"../../input/handlers/support.js";import{Drag as D}from"../../input/recognizers/Drag.js";import{ImmediateDoubleClick as O}from"../../input/recognizers/ImmediateDoubleClick.js";import{PointerClickHoldAndDrag as k}from"../../input/recognizers/PointerClickHoldAndDrag.js";import{SingleAndDoubleClick as A}from"../../input/recognizers/SingleAndDoubleClick.js";import{VerticalTwoFingerDrag as j}from"../../input/recognizers/VerticalTwoFingerDrag.js";const M=`modeDependentNavigation`;let N=class extends t{constructor(){super(...arguments),this.mode=`default`,this._keys={fov:`Shift`,pan:{left:`ArrowLeft`,right:`ArrowRight`,forward:`ArrowUp`,backward:`ArrowDown`,up:[`u`,`U`],down:[`j`,`J`]},lookAround:{headingLeft:[`a`,`A`],headingRight:[`d`,`D`],tiltUp:[`w`,`W`],tiltDown:[`s`,`S`]},modifier:[`b`,`B`],zoom:{zoomIn:[`+`,`=`],zoomOut:[`-`,`_`]},reset:{heading:[`n`,`N`],tilt:[`p`,`P`]},precisionPanModifier:`Alt`,coarsePanModifier:`Shift`},this._updateMode=({mode:e,dragPrimary:t,dragSecondary:n,dragTertiary:r})=>{e===`pro`&&(n=`zoom`,r=t===`pan`?`rotate`:`pan`);let i={dragPrimary:t,dragSecondary:n,dragTertiary:r};this._modeDragPan&&(this._modeDragPan.pointerActions=E(`pan`,i)),this._modeGroundNavigation&&(this._modeGroundNavigation.pointerActions=E(`pan`,i)),this._modeDragRotate&&(this._modeDragRotate.pointerActions=E(`rotate`,i)),this._modeGroundNavigationDragRotate&&(this._modeGroundNavigationDragRotate.pointerActions=E(`rotate`,i)),this._modeDragZoom&&(this._modeDragZoom.pointerActions=E(`zoom`,i))}}destroy(){this.disconnect()}get primaryDragAction(){return this.view.navigation.actionMap.dragPrimary}set primaryDragAction(e){let{actionMap:t}=this.view.navigation;t.dragPrimary=e,t.dragSecondary=e===`pan`?`rotate`:`pan`}get updating(){return!!this._inputManager?.updating}get latestPointerInfo(){return this._inputManager?.latestPointerInfo}get latestPenInfo(){return this._inputManager?.latestPenInfo}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}disconnect(){this.removeAllHandles(),this.view.viewEvents.disconnect(),this._modeDragPan=null,this._modeGroundNavigation=null,this._modeDragRotate=null,this._modeGroundNavigationDragRotate=null,this._modeDragZoom=null,this._modeKeyboardNavigation=null,this._inputManager=n(this._inputManager),this._source=n(this._source)}connect(){let e=this.view;this._source=new x(this.view.surface,e.input);let t=[new O,new k,new A,new D(this.view.navigation),new j],n=new S({eventSource:this._source,recognizers:t});this._inputManager=n,n.installHandlers(`prevent-context-menu`,[new w],C.INTERNAL),n.installHandlers(`prevent-touch-text-selection-gesture`,[new T(this.view)],C.INTERNAL),this._modeDragPan=new g(e,[`primary`]),this._modeDragRotate=new l(e,[`secondary`],0),this._modeDragZoom=new u(e,[`tertiary`],this._keys.fov),this._modeKeyboardNavigation=new p(e,this._keys);let o=[new _(e),new c(e),new f(e),new m(e,this._keys.fov,!0),new h(e),new d(e),new l(e,[`primary`],1,this._keys.modifier),new b(e,[`secondary`],this._keys.modifier),this._modeDragRotate,this._modeDragZoom,this._modeDragPan,this._modeKeyboardNavigation,new v(e)];this._modeGroundNavigation=new b(e,[`primary`]),this._modeGroundNavigationDragRotate=new l(e,[`secondary`],1);let s=[this._modeGroundNavigation,new m(e,this._keys.fov,!1),new b(e,[`tertiary`]),this._modeGroundNavigationDragRotate,this._modeKeyboardNavigation,new y(e)];this.view.viewEvents.connect(n),this.addHandles([r(()=>this.view.navigation.mode,e=>{switch(n.hasHandlers(M)&&n.uninstallHandlers(M),e.type){case`default`:n.installHandlers(M,o,C.INTERNAL);break;case`ground`:n.installHandlers(M,s,C.INTERNAL)}},{initial:!0}),r(()=>this.view.navigation?.browserTouchPanEnabled,e=>{this._source.browserTouchPanningEnabled=!e},i),r(()=>{let{actionMap:e}=this.view.navigation,{dragPrimary:t,dragSecondary:n,dragTertiary:r}=e;return{mode:this.mode,dragPrimary:t,dragSecondary:n,dragTertiary:r}},this._updateMode,a)])}isModifierKeyDown(e){return this._inputManager?.isModifierKeyDown(e)??!1}get test(){}};e([o()],N.prototype,`view`,void 0),e([o({type:[`default`,`pro`]})],N.prototype,`mode`,void 0),e([o({readOnly:!0})],N.prototype,`updating`,null),e([o()],N.prototype,`latestPointerInfo`,null),e([o()],N.prototype,`latestPenInfo`,null),e([o()],N.prototype,`multiTouchActive`,null),e([o()],N.prototype,`_inputManager`,void 0),N=e([s(`esri.views.3d.input.SceneInputManager`)],N);const P=N;export{P as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{createScreenPointArray as e}from"../../../../core/screenUtils.js";import{FovController as t}from"../../state/controllers/FovController.js";import{ZoomControllerGlobal as n}from"../../state/controllers/ZoomControllerGlobal.js";import{ZoomControllerLocal as r}from"../../state/controllers/ZoomControllerLocal.js";import{InputHandler as i}from"../../../input/InputHandler.js";import{eventMatchesMousePointerActions as a}from"../../../input/handlers/support.js";class o extends i{constructor(e,t,n){super(!0),this._view=e,this.pointerActions=t,this._fovModifier=n,this.registerIncoming(`drag`,[n],e=>this._handleZoom(e)),this.registerIncoming(`drag`,e=>this._handleZoom(e))}_handleZoom(i){let o=i.data;if(o.pointers.size>1||!a(i.data,this.pointerActions))return;let s=e(o.center.x,o.center.y);switch(o.action){case`start`:{this._cameraController?.finish();let e=this._view,a=i.modifiers.has(this._fovModifier);this._cameraController=a?new t({view:e,onStop:()=>this._stopController()}):e.state.isGlobal?new n({view:e}):new r({view:e}),this._view.state.switchCameraController(this._cameraController),this._cameraController.begin(s);break}case`update`:this._cameraController?.update(s);break;case`end`:this._cameraController instanceof t?this._cameraController.updateTimeout():this._stopController()}i.stopPropagation()}_stopController(){this._cameraController?.finish(),this._cameraController=null}}export{o as DragZoom};
2
+ import{createScreenPointArray as e}from"../../../../core/screenUtils.js";import{FovController as t}from"../../state/controllers/FovController.js";import{ZoomControllerGlobal as n}from"../../state/controllers/ZoomControllerGlobal.js";import{ZoomControllerLocal as r}from"../../state/controllers/ZoomControllerLocal.js";import{InputHandler as i}from"../../../input/InputHandler.js";import{eventMatchesMousePointerActions as a}from"../../../input/handlers/support.js";class o extends i{constructor(e,t,n){super(!0),this._view=e,this.pointerActions=t,this._fovModifier=n,this.registerIncoming(`drag`,[n],e=>this._handleZoom(e)),this.registerIncoming(`drag`,e=>this._handleZoom(e))}_handleZoom(i){let o=i.data;if(o.pointers.size>1||!a(i.data,this.pointerActions))return;let s=e(o.center.x,o.center.y);switch(o.action){case`start`:{this._cameraController?.finish();let e=this._view,a=i.modifiers.has(this._fovModifier);this._cameraController=a?new t({view:e,onStop:()=>this._stopController(),enableDolly:!0}):e.state.isGlobal?new n({view:e}):new r({view:e}),this._view.state.switchCameraController(this._cameraController),this._cameraController.begin(s);break}case`update`:this._cameraController?.update(s);break;case`end`:this._cameraController instanceof t?this._cameraController.updateTimeout():this._stopController()}i.stopPropagation()}_stopController(){this._cameraController?.finish(),this._cameraController=null}}export{o as DragZoom};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{FovController as e}from"../../state/controllers/FovController.js";import{InputHandler as t}from"../../../input/InputHandler.js";class n extends t{constructor(e,t){super(!0),this._view=e,this.registerIncoming(`mouse-wheel`,[t],e=>this._handleFov(e))}_handleFov(t){if(this._mouseWheelFovChangeEnabled){if(!this._fovController?.running&&(this._fovController?.hideOverlay(),this._fovController=new e({view:this._view,onStop:()=>this._stopFovController()}),this._view.state.switchCameraController(this._fovController),this._fovController.state===1)){this._stopFovController();return}this._fovController.updateTimeout(),this._fovController.step(t.data.deltaY/20),t.preventDefault(),t.stopPropagation()}}get _mouseWheelFovChangeEnabled(){return this._view.navigation.actionMap.mouseWheel===`zoom`}_stopFovController(){this._fovController?.finish(),this._fovController=null}}export{n as MouseWheelFov};
2
+ import{FovController as e}from"../../state/controllers/FovController.js";import{InputHandler as t}from"../../../input/InputHandler.js";class n extends t{constructor(e,t,n){super(!0),this._view=e,this._enableDolly=n,this.registerIncoming(`mouse-wheel`,[t],e=>this._handleFov(e))}_handleFov(t){if(this._mouseWheelFovChangeEnabled){if(!this._fovController?.running&&(this._fovController?.hideOverlay(),this._fovController=new e({view:this._view,onStop:()=>this._stopFovController(),enableDolly:this._enableDolly}),this._view.state.switchCameraController(this._fovController),this._fovController.state===1)){this._stopFovController();return}this._fovController.updateTimeout(),this._fovController.step(t.data.deltaY/20),t.preventDefault(),t.stopPropagation()}}get _mouseWheelFovChangeEnabled(){return this._view.navigation.actionMap.mouseWheel===`zoom`}_stopFovController(){this._fovController?.finish(),this._fovController=null}}export{n as MouseWheelFov};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{isSome as t}from"../../../../../core/arrayUtils.js";import n from"../../../../../core/Collection.js";import{EventEmitter as r}from"../../../../../core/Evented.js";import{makeHandle as i}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as a}from"../../../../../core/maybe.js";import{debounce as o}from"../../../../../core/promiseUtils.js";import{scale as s,zeroMeters as c}from"../../../../../core/quantity.js";import{watch as l,initial as u,syncAndInitial as d}from"../../../../../core/reactiveUtils.js";import{property as f,subclass as p}from"../../../../../core/accessorSupport/decorators.js";import{ensureType as m}from"../../../../../core/accessorSupport/ensureType.js";import{UpdatingHandles as ee}from"../../../../../core/support/UpdatingHandles.js";import te from"../../../../../geometry/Point.js";import{makeDehydratedPoint as h}from"../../../../../layers/graphics/dehydratedPoint.js";import{SnappingVisualizer3D as g}from"../../SnappingVisualizer3D.js";import{orientation as _}from"../geometryUtils.js";import{manipulatedObjectGeometry as v,supportsElevationMode as y}from"../manipulatedObjectUtils.js";import{canMoveZOperations as b}from"../manipulatorUtils.js";import{meshTransformFastUpdateHandles as x}from"../meshFastUpdateUtils.js";import{connectTooltipToManipulatedObject as S}from"../tooltipUtils3D.js";import{createVisualElements as C}from"../visualElementUtils.js";import{discRadius as ne}from"../manipulations/config.js";import{MoveManipulation as w}from"../manipulations/MoveManipulation.js";import{axisConstrainedDragSign as T}from"../manipulations/moveUtils.js";import{MoveXYObjectManipulation as E}from"../manipulations/MoveXYObjectManipulation.js";import{isSupportedObject as D}from"./isSupportedObject.js";import{OutlineVisualElement as O}from"../../visualElements/OutlineVisualElement.js";import{createElevationUpdateHandle as k}from"../../../support/elevationUpdateUtils.js";import{dragManipulatedObjectMany as A,resetManipulatedObjectMany as j}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as M}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as N}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import P from"../../../../interactive/options/InteractiveToolOptions.js";import{SnappingContext as F}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as I}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as L,enterInputModeIfAvailable as R}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as z}from"../../../../interactive/tooltip/infos/MovePointTooltipInfo.js";import{TranslateTooltipInfo as B}from"../../../../interactive/tooltip/infos/TranslateTooltipInfo.js";import{TranslateXYTooltipInfo as V}from"../../../../interactive/tooltip/infos/TranslateXYTooltipInfo.js";import{TranslateZTooltipInfo as H}from"../../../../interactive/tooltip/infos/TranslateZTooltipInfo.js";import{verticalSignedDistanceBetweenPoints as U}from"../../../../support/euclideanLengthMeasurementUtils.js";import{GeometryWorkerHandle as W}from"../../../../support/GeometryWorkerHandle.js";class G{constructor(e){this.objects=e,this.type=`move-start`}}class K{constructor(e,t,n){this.dx=e,this.dy=t,this.objects=n,this.type=`move`}}class q{constructor(e){this.objects=e,this.type=`move-stop`}}class J{constructor(e){this.objects=e,this.type=`hold`}}const Y=Symbol(`manipulators`),X=Symbol(`tooltips`),Z=Symbol(`move-manipulator-display`);let Q=class extends M{get _infos(){return Array.from(this._infosByType.values())}constructor(e){super(e),this._infosByType=new Map,this.events=new r,this.objects=new n,this.enableVisualElements=!0,this.enableZ=!0,this.manipulatorRadius=null,this.toolOptions=new P,this.type=`move-3d`,this._measurementWorker=new W({preloadGeodetic:!0}),this._ownedTooltip=null,this._latestTooltipInfo=null,this._translateTooltipInfo=null,this._translateXYTooltipInfo=null,this._translateZTooltipInfo=null,this._updatingHandles=new ee,this._moveManipulation=null,this._updateMoveTooltipDistanceDebounced=o(this._updateMoveTooltipDistanceAsync.bind(this))}initialize(){let{view:e}=this;this.tooltip??=this._ownedTooltip=L(()=>({view:e,options:this.toolOptions.tooltips})),this.addHandles(this._updatingHandles.addOnCollectionChange(()=>this.objects,e=>{e.removed.forEach(e=>this.removeHandles(e)),this._updateObjectInfos(e),this._setupObjectUpdateHandles(e.added),this._refreshManipulators(),this._connectTooltips()}));let t=this.objects.toArray();this._updateObjectInfos({added:t,removed:[]}),this._setupObjectUpdateHandles(t),this._refreshManipulators(),this._connectTooltips(),this.finishToolCreation()}destroy(){this._ownedTooltip=a(this._ownedTooltip),this._moveManipulation=a(this._moveManipulation),this._set(`view`,null),this._updatingHandles.destroy(),this._measurementWorker.destroy()}onInputEvent(e){if(this.destroyed||R(e,this.tooltip))return;let t=this.firstGrabbedManipulator;if(e.type===`hold`&&t!=null){let e=this._getActiveObjectInfos(this._infos,t).map(({object:e})=>e);this.events.emit(`hold`,new J(e))}return super.onInputEvent(e)}get updating(){return this._updatingHandles.updating||!!this.snappingManager?.updating}get _shouldShowMovePointTooltip(){let{objects:e}=this;if(e.length!==1)return!1;let t=v(e.at(0))?.type;return t===`point`||t===`mesh`}get activeTooltipInfo(){return this._shouldShowMovePointTooltip?this._movePointTooltipInfo:this._latestTooltipInfo}reset(){}_updateObjectInfos({added:e,removed:t}){for(let t of e){if(D(t)!==0)continue;let e=new re(t);this._infosByType.set(t,e)}for(let e of t)this._infosByType.delete(e)}_setupObjectUpdateHandles(e){for(let t of e){let e=this._infosByType.get(t);this.addHandles(x(e.object),t),y(t)&&this.addHandles(l(()=>{let{mode:e,unit:n,offset:r}=t.elevationInfo;return[e,n,r]},()=>this._refreshManipulators()),t)}}_refreshManipulators(){if(this.removeHandles(Y),this.removeHandles(Z),this._moveManipulation=a(this._moveManipulation),this.manipulators.removeAll(),this._infosByType.size===0)return;let e=this._infos;this._createManipulators(e),this._createVisualElements(e),this._updateMoveManipulation(e)}_createManipulators(e){for(let t of e){let n=t.object;t.manipulationXY=new E({tool:this,view:this.view,object:n}),t.manipulationXY.forEachManipulator(e=>{this.addHandles([e.events.on(`immediate-click`,e=>{this.events.emit(`immediate-click`,{...e,object:n}),e.stopPropagation()}),e.events.on(`grab-changed`,({action:e})=>{e===`start`?this._showTooltip(0):this._hideTooltip(),this._updateMoveManipulatorDisplay()})],Y)}),this.addHandles(t.manipulationXY.createDragPipeline((t,n,r,i)=>this._buildDragEventPipeline(e,0,t,n,r,i)),Y)}this._createMoveManipulation(e)}_updateMoveManipulatorDisplay(){let e=this._infos.some(e=>e.manipulationXY?.grabbing);this._moveManipulation&&(this._moveManipulation.interactive=!e),this.removeHandles(Z),e&&this._moveManipulation&&this.addHandles(this._moveManipulation.hideManipulators(),Z)}_createMoveManipulation(e){let t=new w({tool:this,view:this.view,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:this.manipulatorRadius??(e.length===1?w.radiusForSymbol(e[0].object.graphic?.symbol):ne)});this._moveManipulation=t,t.elevationInfo={mode:`absolute-height`,offset:0},t.forEachManipulator(e=>{this.addHandles(e.events.on(`immediate-click`,n=>{let r=this.objects.at(0);!t.zManipulation.hasManipulator(e)&&this.objects.length===1&&r&&this.events.emit(`immediate-click`,{...n,object:r}),n.stopPropagation()}),Y)});let n=e=>t=>{this.addHandles([t.events.on(`focus-changed`,({action:t})=>{t===`focus`?this._showTooltip(e):this._hideTooltip()}),t.events.on(`grab-changed`,()=>{this._latestTooltipInfo&&(this._latestTooltipInfo.distance=c)})],Y)};this._moveManipulation.xyManipulation.forEachManipulator(n(0)),this._moveManipulation.xyAxisManipulation.forEachManipulator(n(1)),this._moveManipulation.zManipulation.forEachManipulator(n(2));let r=()=>this._updateMoveManipulation(e);for(let t of e){this.addHandles([t.object.on(`committed`,r),this._updatingHandles.add(()=>t.object.visible,r)],Y);let n=Symbol();this.addHandles(this._updatingHandles.add(()=>t.object.isDraped,r=>{this._updateMoveManipulation(e),this.removeHandles(n),r&&this.addHandles(k({view:this.view,geometry:t.object.graphic?.geometry,elevationInfo:t.object.elevationInfo,onElevationChanges:()=>this._updateMoveManipulation(e)}),n)},u),Y),this.addHandles(i(()=>this.removeHandles(n)),Y)}let a=e[e.length-1];this.addHandles(a.object.on(`committed`,()=>this._updateMoveManipulationAngle(a)),Y);let{object:o}=a,{operations:s}=o;if(s){let n=o.graphic;this.addHandles(t.createDragPipeline((t,n,r,i,a)=>this._buildDragEventPipeline(e,t,n,r,i,a),o.elevationInfo,s.data.spatialReference,n),Y)}this._updateMoveManipulationAngle(a)}_createVisualElements(e){if(this.enableVisualElements)for(let t of e){let n=t.object,r=C({view:this.view,object:n,forEachManipulator:e=>{t.manipulationXY?.forEachManipulator(e),this._moveManipulation?.forEachManipulator(e)},onManipulatorsChanged:()=>i()});r!=null&&(t.geometryRepresentation=r.visualElement,t.geometryRepresentation instanceof O&&this.addHandles([t.geometryRepresentation.events.on(`attachment-origin-changed`,()=>{t.object.isDraped||this._updateMoveManipulation(e)}),this._updatingHandles.add(()=>t.object.isDraped,()=>this._updateMoveManipulation(e))],Y),this.addHandles(r,Y))}}_updateMoveManipulationAngle(e){this._moveManipulation&&(this._moveManipulation.angle=_(v(e.object)))}_updateMoveManipulation(e){let t=h(0,0,0,this.view.spatialReference),n=0,r=!1,i=this._moveManipulation;if(i){for(let i of e){if(!i.object.visible)continue;this.enableZ&&b(i.object.operations,i.object.elevationInfo)&&(r=!0);let e=i.geometryRepresentation instanceof O&&!i.object.isDraped?i.geometryRepresentation.attachmentOrigin:i.object.origin;if(e!=null){let{x:r,y:i,z:a}=e;t.x+=r,t.y+=i,a&&(t.z??=0,t.z+=a),n++}}n>0?(t.x/=n,t.y/=n,t.z??=0,t.z/=n,i.location=t,i.xyManipulation.available=!0,i.xyAxisManipulation.available=!0,i.zManipulation.available=r):i.available=!1}}_buildDragEventPipeline(e,t,n,r,i,a){let o=[],s=[],c=null,l=null,u=()=>{for(let e of o)e.dragging=!1;o.length=0,s.length=0,c=null,l=null,this._updateMoveManipulatorDisplay()};if(e.length===1&&t===0){let t=e[0].object;({steps:r,cancel:i}=this._buildSnappingPipelineSteps(t,t.elevationInfo,r,i,a))}return i=i.next(e=>l?.(e)).next(()=>(s.length&&this.events.emit(`move-stop`,new q(s)),this.destroyed||u(),null)),r=r.next(t=>{if(t.action===`start`){o.length=0,s.length=0;for(let t of this._getActiveObjectInfos(e,n))o.push(t),s.push(t.object),t.dragging=!0;if(s.length!==0&&(this._moveManipulation&&(this._moveManipulation.interactive=!1),c=A(s),l=j(s),this._emitRecordUndo(),this.events.emit(`move-start`,new G(s)),this.destroyed))return null}return s.length===0?null:t}).next(e=>c?.(e)).next(e=>(this._updateMoveTooltip(t,e),e)).next(e=>{switch(e.action){case`start`:case`update`:if(e.translationX||e.translationY||e.translationZ){let t=this.view.toScreen(e.mapStart),n=this.view.toScreen(e.mapEnd);if(!t||!n)return null;let r=n.x-t.x,i=n.y-t.y;if(this.events.emit(`move`,new K(r,i,s)),this.destroyed)return null}break;case`end`:if(this.events.emit(`move-stop`,new q(s)),this.destroyed)return null;u()}return null}),{steps:r,cancel:i}}_getActiveObjectInfos(e,t){return e.filter(e=>!e.dragging&&(e.manipulationXY?.hasManipulator(t)||!e.manipulationXY?.grabbing))}_connectTooltips(){this.removeHandles(X),this._latestTooltipInfo=null;let e;if(this._shouldShowMovePointTooltip){let t=this.objects.at(0),{events:n}=this;this._movePointTooltipInfo??=new z({viewType:this.view.type,toolOptions:this.toolOptions});let r={onBeforeUpdate:()=>this.endDrag(),onMoveStart:()=>{this._emitRecordUndo(),n.emit(`move-start`,new G([t]))},onMove:()=>n.emit(`move`,new K(0,0,[t])),onMoveStop:()=>n.emit(`move-stop`,new q([t])),onRotateStart:()=>{},onRotate:()=>{},onRotateStop:()=>{},onScaleStart:()=>{},onScale:()=>{},onScaleStop:()=>{}};e=S(this.tooltip,t,()=>({toolOptions:this.toolOptions,activeTooltipInfo:this._movePointTooltipInfo,callbacks:r,onRecordUndo:e=>n.emit(`record-undo`,{updates:[e]})}))}else e=this._updatingHandles.add(()=>this.toolOptions.tooltips.effectiveEnabled?this._latestTooltipInfo:null,e=>{this.tooltip.info=e},d);this.addHandles(e,X)}_showTooltip(e){this._shouldShowMovePointTooltip||this._updateMoveTooltip(e)}_hideTooltip(){this._shouldShowMovePointTooltip||(this.tooltip?.clear(),this._latestTooltipInfo=null)}_updateMoveTooltip(e,t){if(this._shouldShowMovePointTooltip||this.objects.length===0)return;let{toolOptions:n}=this;switch(e){case 0:this._latestTooltipInfo=this._translateTooltipInfo??=new B({toolOptions:n}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,t,(e,t)=>this._measurementWorker.autoDistance2DBetweenPoints($(e),$(t))));break;case 1:this._latestTooltipInfo=this._translateXYTooltipInfo??=new V({toolOptions:n}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,t,async(e,n)=>s(await this._measurementWorker.autoDistance2DBetweenPoints($(e),$(n)),T(t))));break;case 2:this._latestTooltipInfo=this._translateZTooltipInfo??=new H({toolOptions:n}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,t,U))}this._latestTooltipInfo.toolOptions=n}async _updateMoveTooltipDistanceAsync(e,t,n){if(t!=null&&t.action!==`end`){let{mapStart:r,mapEnd:i}=t;e.distance=await n(r,i)??c}else e.distance=c}_emitRecordUndo(){let e=this.objects.toArray().map(e=>e.createUndoRecord?.()).filter(t);e.length>0&&this.events.emit(`record-undo`,{updates:e})}_buildSnappingPipelineSteps(e,t,n,r,i){let a=v(e);if(a==null||a.type!==`point`&&a.type!==`mesh`)return{steps:n,cancel:r};let o=(a.type===`point`?a:a.origin).clone(),s=new F({elevationInfo:t,pointer:i,editGeometryOperations:N.fromGeometry(o,this.view.state.viewingMode),visualizer:new g,excludeFeature:e.graphic}),c=this.snappingManager,{snappingStep:l,cancelSnapping:u}=I({snappingContext:s,snappingManager:c,updatingHandles:this._updatingHandles,useZ:!1});return r=r.next(u),n=n.next(e=>{let t=s.coordinateHelper.pointToVector(o);return{...e,snapOrigin:t}}).next(...l),{steps:n,cancel:r}}get test(){}};e([f({constructOnly:!0,nonNullable:!0})],Q.prototype,`view`,void 0),e([f()],Q.prototype,`objects`,void 0),e([f({constructOnly:!0,nonNullable:!0})],Q.prototype,`enableVisualElements`,void 0),e([f({constructOnly:!0,nonNullable:!0})],Q.prototype,`enableZ`,void 0),e([f({constructOnly:!0})],Q.prototype,`manipulatorRadius`,void 0),e([f({constructOnly:!0,type:P})],Q.prototype,`toolOptions`,void 0),e([f({constructOnly:!0})],Q.prototype,`snappingManager`,void 0),e([f()],Q.prototype,`type`,void 0),e([f()],Q.prototype,`updating`,null),e([f()],Q.prototype,`tooltip`,void 0),e([f()],Q.prototype,`_ownedTooltip`,void 0),e([f()],Q.prototype,`_latestTooltipInfo`,void 0),e([f()],Q.prototype,`_shouldShowMovePointTooltip`,null),e([f()],Q.prototype,`activeTooltipInfo`,null),Q=e([p(`esri.views.3d.interactive.editingTools.move.MoveTool3D`)],Q);const $=m(te);class re{constructor(e){this.object=e,this.geometryRepresentation=null,this.manipulationXY=null,this.dragging=!1}}export{J as HoldEvent,K as MoveEvent,G as MoveStartEvent,q as MoveStopEvent,Q as MoveTool3D};
2
+ import{__decorate as e}from"tslib";import{isSome as t}from"../../../../../core/arrayUtils.js";import n from"../../../../../core/Collection.js";import{EventEmitter as r}from"../../../../../core/Evented.js";import{makeHandle as i}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as a}from"../../../../../core/maybe.js";import{debounce as o}from"../../../../../core/promiseUtils.js";import{scale as s,zeroMeters as c}from"../../../../../core/quantity.js";import{watch as l,initial as u,syncAndInitial as d}from"../../../../../core/reactiveUtils.js";import{property as f,subclass as p}from"../../../../../core/accessorSupport/decorators.js";import{ensureType as m}from"../../../../../core/accessorSupport/ensureType.js";import{UpdatingHandles as ee}from"../../../../../core/support/UpdatingHandles.js";import te from"../../../../../geometry/Point.js";import{makeDehydratedPoint as h}from"../../../../../layers/graphics/dehydratedPoint.js";import{SnappingVisualizer3D as g}from"../../SnappingVisualizer3D.js";import{orientation as _}from"../geometryUtils.js";import{manipulatedObjectGeometry as v,supportsElevationMode as y}from"../manipulatedObjectUtils.js";import{canMoveZOperations as b}from"../manipulatorUtils.js";import{meshTransformFastUpdateHandles as x}from"../meshFastUpdateUtils.js";import{connectTooltipToManipulatedObject as S}from"../tooltipUtils3D.js";import{createVisualElements as C}from"../visualElementUtils.js";import{discRadius as ne}from"../manipulations/config.js";import{MoveManipulation as w}from"../manipulations/MoveManipulation.js";import{axisConstrainedDragSign as T}from"../manipulations/moveUtils.js";import{MoveXYObjectManipulation as E}from"../manipulations/MoveXYObjectManipulation.js";import{isSupportedObject as D}from"./isSupportedObject.js";import{OutlineVisualElement as O}from"../../visualElements/OutlineVisualElement.js";import{createElevationUpdateHandle as k}from"../../../support/elevationUpdateUtils.js";import{dragManipulatedObjectMany as A,resetManipulatedObjectMany as j}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as M}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as N}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import P from"../../../../interactive/options/InteractiveToolOptions.js";import{SnappingContext as F}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as I}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as L,enterInputModeIfAvailable as R}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as z}from"../../../../interactive/tooltip/infos/MovePointTooltipInfo.js";import{TranslateTooltipInfo as B}from"../../../../interactive/tooltip/infos/TranslateTooltipInfo.js";import{TranslateXYTooltipInfo as V}from"../../../../interactive/tooltip/infos/TranslateXYTooltipInfo.js";import{TranslateZTooltipInfo as H}from"../../../../interactive/tooltip/infos/TranslateZTooltipInfo.js";import{verticalSignedDistanceBetweenPoints as U}from"../../../../support/euclideanLengthMeasurementUtils.js";import{GeometryWorkerHandle as W}from"../../../../support/GeometryWorkerHandle.js";class G{constructor(e){this.objects=e,this.type=`move-start`}}class K{constructor(e,t,n){this.dx=e,this.dy=t,this.objects=n,this.type=`move`}}class q{constructor(e){this.objects=e,this.type=`move-stop`}}class J{constructor(e){this.objects=e,this.type=`hold`}}const Y=Symbol(`manipulators`),X=Symbol(`tooltips`),Z=Symbol(`move-manipulator-display`);let Q=class extends M{get _infos(){return Array.from(this._infosByType.values())}constructor(e){super(e),this._infosByType=new Map,this.events=new r,this.objects=new n,this.enableVisualElements=!0,this.enableZ=!0,this.manipulatorRadius=null,this.toolOptions=new P,this.type=`move-3d`,this._measurementWorker=new W({preloadGeodetic:!0}),this._ownedTooltip=null,this._latestTooltipInfo=null,this._translateTooltipInfo=null,this._translateXYTooltipInfo=null,this._translateZTooltipInfo=null,this._updatingHandles=new ee,this._moveManipulation=null,this._updateMoveTooltipDistanceDebounced=o(this._updateMoveTooltipDistanceAsync.bind(this))}initialize(){let{view:e}=this;this.tooltip??=this._ownedTooltip=L(()=>({view:e,options:this.toolOptions.tooltips})),this.addHandles(this._updatingHandles.addOnCollectionChange(()=>this.objects,e=>{e.removed.forEach(e=>this.removeHandles(e)),this._updateObjectInfos(e),this._setupObjectUpdateHandles(e.added),this._refreshManipulators(),this._connectTooltips()}));let t=this.objects.toArray();this._updateObjectInfos({added:t,removed:[]}),this._setupObjectUpdateHandles(t),this._refreshManipulators(),this._connectTooltips(),this.finishToolCreation()}destroy(){this._ownedTooltip=a(this._ownedTooltip),this._moveManipulation=a(this._moveManipulation),this._set(`view`,null),this._updatingHandles.destroy(),this._measurementWorker.destroy()}onInputEvent(e){if(this.destroyed||R(e,this.tooltip))return;let t=this.firstGrabbedManipulator;if(e.type===`hold`&&t!=null){let e=this._getActiveObjectInfos(this._infos,t).map(({object:e})=>e);this.events.emit(`hold`,new J(e))}return super.onInputEvent(e)}get updating(){return this._updatingHandles.updating||!!this.snappingManager?.updating}get _shouldShowMovePointTooltip(){let{objects:e}=this;if(e.length!==1)return!1;let t=v(e.at(0))?.type;return t===`point`||t===`mesh`}get activeTooltipInfo(){return this._shouldShowMovePointTooltip?this._movePointTooltipInfo:this._latestTooltipInfo}reset(){}_updateObjectInfos({added:e,removed:t}){for(let t of e){if(D(t)!==0)continue;let e=new re(t);this._infosByType.set(t,e)}for(let e of t)this._infosByType.delete(e)}_setupObjectUpdateHandles(e){for(let t of e){let e=this._infosByType.get(t);this.addHandles(x(e.object),t),y(t)&&this.addHandles(l(()=>{let{mode:e,unit:n,offset:r}=t.elevationInfo;return[e,n,r]},()=>this._refreshManipulators()),t)}}_refreshManipulators(){if(this.removeHandles(Y),this.removeHandles(Z),this._moveManipulation=a(this._moveManipulation),this.manipulators.removeAll(),this._infosByType.size===0)return;let e=this._infos;this._createManipulators(e),this._createVisualElements(e),this._updateMoveManipulation(e)}_createManipulators(e){for(let t of e){let n=t.object;t.manipulationXY=new E({tool:this,view:this.view,object:n}),t.manipulationXY.forEachManipulator(e=>{this.addHandles([e.events.on(`immediate-click`,e=>{this.events.emit(`immediate-click`,{...e,object:n}),e.stopPropagation()}),e.events.on(`grab-changed`,({action:e})=>{e===`start`?this._showTooltip(0):this._hideTooltip(),this._updateMoveManipulatorDisplay()})],Y)}),this.addHandles(t.manipulationXY.createDragPipeline((t,n,r,i)=>this._buildDragEventPipeline(e,0,t,n,r,i)),Y)}this._createMoveManipulation(e)}_updateMoveManipulatorDisplay(){let e=this._infos.some(e=>e.manipulationXY?.grabbing);this._moveManipulation&&(this._moveManipulation.interactive=!e),this.removeHandles(Z),e&&this._moveManipulation&&this.addHandles(this._moveManipulation.hideManipulators(),Z)}_createMoveManipulation(e){let t=new w({tool:this,view:this.view,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:this.manipulatorRadius??(e.length===1?w.radiusForSymbol(e[0].object.graphic?.symbol):ne)});this._moveManipulation=t,t.elevationInfo={mode:`absolute-height`,offset:0},t.forEachManipulator(e=>{this.addHandles(e.events.on(`immediate-click`,n=>{let r=this.objects.at(0);!t.zManipulation.hasManipulator(e)&&this.objects.length===1&&r&&this.events.emit(`immediate-click`,{...n,object:r}),n.stopPropagation()}),Y)});let n=e=>t=>{this.addHandles([t.events.on(`focus-changed`,({action:t})=>{t===`focus`?this._showTooltip(e):this._hideTooltip()}),t.events.on(`grab-changed`,()=>{this._latestTooltipInfo&&(this._latestTooltipInfo.distance=c)})],Y)};this._moveManipulation.xyManipulation.forEachManipulator(n(0)),this._moveManipulation.xyAxisManipulation.forEachManipulator(n(1)),this._moveManipulation.zManipulation.forEachManipulator(n(2));let r=()=>this._updateMoveManipulation(e);for(let t of e){this.addHandles([t.object.on(`committed`,r),this._updatingHandles.add(()=>t.object.visible,r)],Y);let n=Symbol();this.addHandles(this._updatingHandles.add(()=>t.object.isDraped,r=>{this._updateMoveManipulation(e),this.removeHandles(n),r&&this.addHandles(k({view:this.view,geometry:()=>t.object.graphic?.geometry,elevationInfo:t.object.elevationInfo,onElevationChanges:()=>this._updateMoveManipulation(e)}),n)},u),Y),this.addHandles(i(()=>this.removeHandles(n)),Y)}let a=e[e.length-1];this.addHandles(a.object.on(`committed`,()=>this._updateMoveManipulationAngle(a)),Y);let{object:o}=a,{operations:s}=o;if(s){let n=o.graphic;this.addHandles(t.createDragPipeline((t,n,r,i,a)=>this._buildDragEventPipeline(e,t,n,r,i,a),o.elevationInfo,s.data.spatialReference,n),Y)}this._updateMoveManipulationAngle(a)}_createVisualElements(e){if(this.enableVisualElements)for(let t of e){let n=t.object,r=C({view:this.view,object:n,forEachManipulator:e=>{t.manipulationXY?.forEachManipulator(e),this._moveManipulation?.forEachManipulator(e)},onManipulatorsChanged:()=>i()});r!=null&&(t.geometryRepresentation=r.visualElement,t.geometryRepresentation instanceof O&&this.addHandles([t.geometryRepresentation.events.on(`attachment-origin-changed`,()=>{t.object.isDraped||this._updateMoveManipulation(e)}),this._updatingHandles.add(()=>t.object.isDraped,()=>this._updateMoveManipulation(e))],Y),this.addHandles(r,Y))}}_updateMoveManipulationAngle(e){this._moveManipulation&&(this._moveManipulation.angle=_(v(e.object)))}_updateMoveManipulation(e){let t=h(0,0,0,this.view.spatialReference),n=0,r=!1,i=this._moveManipulation;if(i){for(let i of e){if(!i.object.visible)continue;this.enableZ&&b(i.object.operations,i.object.elevationInfo)&&(r=!0);let e=i.geometryRepresentation instanceof O&&!i.object.isDraped?i.geometryRepresentation.attachmentOrigin:i.object.origin;if(e!=null){let{x:r,y:i,z:a}=e;t.x+=r,t.y+=i,a&&(t.z??=0,t.z+=a),n++}}n>0?(t.x/=n,t.y/=n,t.z??=0,t.z/=n,i.location=t,i.xyManipulation.available=!0,i.xyAxisManipulation.available=!0,i.zManipulation.available=r):i.available=!1}}_buildDragEventPipeline(e,t,n,r,i,a){let o=[],s=[],c=null,l=null,u=()=>{for(let e of o)e.dragging=!1;o.length=0,s.length=0,c=null,l=null,this._updateMoveManipulatorDisplay()};if(e.length===1&&t===0){let t=e[0].object;({steps:r,cancel:i}=this._buildSnappingPipelineSteps(t,t.elevationInfo,r,i,a))}return i=i.next(e=>l?.(e)).next(()=>(s.length&&this.events.emit(`move-stop`,new q(s)),this.destroyed||u(),null)),r=r.next(t=>{if(t.action===`start`){o.length=0,s.length=0;for(let t of this._getActiveObjectInfos(e,n))o.push(t),s.push(t.object),t.dragging=!0;if(s.length!==0&&(this._moveManipulation&&(this._moveManipulation.interactive=!1),c=A(s),l=j(s),this._emitRecordUndo(),this.events.emit(`move-start`,new G(s)),this.destroyed))return null}return s.length===0?null:t}).next(e=>c?.(e)).next(e=>(this._updateMoveTooltip(t,e),e)).next(e=>{switch(e.action){case`start`:case`update`:if(e.translationX||e.translationY||e.translationZ){let t=this.view.toScreen(e.mapStart),n=this.view.toScreen(e.mapEnd);if(!t||!n)return null;let r=n.x-t.x,i=n.y-t.y;if(this.events.emit(`move`,new K(r,i,s)),this.destroyed)return null}break;case`end`:if(this.events.emit(`move-stop`,new q(s)),this.destroyed)return null;u()}return null}),{steps:r,cancel:i}}_getActiveObjectInfos(e,t){return e.filter(e=>!e.dragging&&(e.manipulationXY?.hasManipulator(t)||!e.manipulationXY?.grabbing))}_connectTooltips(){this.removeHandles(X),this._latestTooltipInfo=null;let e;if(this._shouldShowMovePointTooltip){let t=this.objects.at(0),{events:n}=this;this._movePointTooltipInfo??=new z({viewType:this.view.type,toolOptions:this.toolOptions});let r={onBeforeUpdate:()=>this.endDrag(),onMoveStart:()=>{this._emitRecordUndo(),n.emit(`move-start`,new G([t]))},onMove:()=>n.emit(`move`,new K(0,0,[t])),onMoveStop:()=>n.emit(`move-stop`,new q([t])),onRotateStart:()=>{},onRotate:()=>{},onRotateStop:()=>{},onScaleStart:()=>{},onScale:()=>{},onScaleStop:()=>{}};e=S(this.tooltip,t,()=>({toolOptions:this.toolOptions,activeTooltipInfo:this._movePointTooltipInfo,callbacks:r,onRecordUndo:e=>n.emit(`record-undo`,{updates:[e]})}))}else e=this._updatingHandles.add(()=>this.toolOptions.tooltips.effectiveEnabled?this._latestTooltipInfo:null,e=>{this.tooltip.info=e},d);this.addHandles(e,X)}_showTooltip(e){this._shouldShowMovePointTooltip||this._updateMoveTooltip(e)}_hideTooltip(){this._shouldShowMovePointTooltip||(this.tooltip?.clear(),this._latestTooltipInfo=null)}_updateMoveTooltip(e,t){if(this._shouldShowMovePointTooltip||this.objects.length===0)return;let{toolOptions:n}=this;switch(e){case 0:this._latestTooltipInfo=this._translateTooltipInfo??=new B({toolOptions:n}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,t,(e,t)=>this._measurementWorker.autoDistance2DBetweenPoints($(e),$(t))));break;case 1:this._latestTooltipInfo=this._translateXYTooltipInfo??=new V({toolOptions:n}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,t,async(e,n)=>s(await this._measurementWorker.autoDistance2DBetweenPoints($(e),$(n)),T(t))));break;case 2:this._latestTooltipInfo=this._translateZTooltipInfo??=new H({toolOptions:n}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,t,U))}this._latestTooltipInfo.toolOptions=n}async _updateMoveTooltipDistanceAsync(e,t,n){if(t!=null&&t.action!==`end`){let{mapStart:r,mapEnd:i}=t;e.distance=await n(r,i)??c}else e.distance=c}_emitRecordUndo(){let e=this.objects.toArray().map(e=>e.createUndoRecord?.()).filter(t);e.length>0&&this.events.emit(`record-undo`,{updates:e})}_buildSnappingPipelineSteps(e,t,n,r,i){let a=v(e);if(a==null||a.type!==`point`&&a.type!==`mesh`)return{steps:n,cancel:r};let o=(a.type===`point`?a:a.origin).clone(),s=new F({elevationInfo:t,pointer:i,editGeometryOperations:N.fromGeometry(o,this.view.state.viewingMode),visualizer:new g,excludeFeature:e.graphic}),c=this.snappingManager,{snappingStep:l,cancelSnapping:u}=I({snappingContext:s,snappingManager:c,updatingHandles:this._updatingHandles,useZ:!1});return r=r.next(u),n=n.next(e=>{let t=s.coordinateHelper.pointToVector(o);return{...e,snapOrigin:t}}).next(...l),{steps:n,cancel:r}}get test(){}};e([f({constructOnly:!0,nonNullable:!0})],Q.prototype,`view`,void 0),e([f()],Q.prototype,`objects`,void 0),e([f({constructOnly:!0,nonNullable:!0})],Q.prototype,`enableVisualElements`,void 0),e([f({constructOnly:!0,nonNullable:!0})],Q.prototype,`enableZ`,void 0),e([f({constructOnly:!0})],Q.prototype,`manipulatorRadius`,void 0),e([f({constructOnly:!0,type:P})],Q.prototype,`toolOptions`,void 0),e([f({constructOnly:!0})],Q.prototype,`snappingManager`,void 0),e([f()],Q.prototype,`type`,void 0),e([f()],Q.prototype,`updating`,null),e([f()],Q.prototype,`tooltip`,void 0),e([f()],Q.prototype,`_ownedTooltip`,void 0),e([f()],Q.prototype,`_latestTooltipInfo`,void 0),e([f()],Q.prototype,`_shouldShowMovePointTooltip`,null),e([f()],Q.prototype,`activeTooltipInfo`,null),Q=e([p(`esri.views.3d.interactive.editingTools.move.MoveTool3D`)],Q);const $=m(te);class re{constructor(e){this.object=e,this.geometryRepresentation=null,this.manipulationXY=null,this.dragging=!1}}export{J as HoldEvent,K as MoveEvent,G as MoveStartEvent,q as MoveStopEvent,Q as MoveTool3D};