UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) • 42.9 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Accessor.js";import{removeUnordered as i}from"../../../../../core/arrayUtils.js";import{unitRGBAFromColor as n}from"../../../../../core/colorUtils.js";import"../../../../../core/has.js";import a from"../../../../../core/Evented.js";import o from"../../../../../core/Handles.js";import{handlesGroup as s,makeHandle as r,destroyHandle as l}from"../../../../../core/handleUtils.js";import{destroyMaybe as p,removeMaybe as d}from"../../../../../core/maybe.js";import{watch as u,on as h,initial as c,syncAndInitial as m,when as g,sync as f}from"../../../../../core/reactiveUtils.js";import{property as _}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import{subclass as v}from"../../../../../core/accessorSupport/decorators/subclass.js";import{IDENTITY as M}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{l as b,d as x,m as E,i as O,f as y,g as j}from"../../../../../chunks/vec32.js";import{fromValues as I,create as S}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as H}from"../../../../../core/support/UpdatingHandles.js";import w from"../../../../../geometry/Point.js";import V from"../../../../../geometry/Polyline.js";import A from"../../../../../geometry/SpatialReference.js";import{makeDehydratedPoint as T}from"../../../../../layers/graphics/dehydratedPoint.js";import{isVolumetricSymbol as G}from"../../../../../symbols/support/utils.js";import{Manipulator3D as D}from"../../Manipulator3D.js";import{createManipulatorMaterial as L,createManipulatorOutlineMaterial as P,placeAtObject as U}from"../../manipulatorUtils.js";import{RenderObject as C}from"../../RenderObject.js";import{SegmentLabels3D as N}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as k}from"../../SnappingVisualizer3D.js";import{screenToMapXYAtLocation as R,screenToRenderPlaneFromEvent as z,convertToMapCoordinates as F}from"../dragEventPipeline3D.js";import{orientation as Z}from"../geometryUtils.js";import{ManipulatorType as X}from"../ManipulatorType.js";import{canMoveZOperations as Y}from"../manipulatorUtils.js";import{Settings as q}from"../settings.js";import{createVisualElements as B}from"../visualElementUtils.js";import{discRadiusSmall as W}from"../manipulations/config.js";import{ManipulationType as K,MoveManipulation as J}from"../manipulations/MoveManipulation.js";import{MoveXYObjectManipulation as Q}from"../manipulations/MoveXYObjectManipulation.js";import{getMapPointAtEdgeOffsetManipulatorElevation as $,createEdgeOffsetIntersectionPlane as ee,createEdgeOffsetOperation as te,edgeOffsetRotationMatrix as ie,screenEdgeLengthSquared as ne,getDistanceInGeometrySR as ae}from"./edgeOffsetUtils.js";import{createTooltipInfos as oe,connectTooltipToManipulatedObject as se,getUpdatedTranslateObjectTooltipInfo as re,getUpdatedEdgeOffsetTooltipInfo as le}from"./reshapeTooltipUtils3D.js";import{OutlineVisualElement as pe}from"../../visualElements/OutlineVisualElement.js";import{createExtrudedTriangle as de,createSphereGeometry as ue}from"../../../webgl-engine/lib/GeometryUtil.js";import{MouseButton as he}from"../../../../input/IViewEvents.js";import{sceneSnappingAtLocation as ce,addMapDelta as me,createManipulatorDragEventPipeline as ge,dragAtLocation as fe,addScreenDelta as _e}from"../../../../interactive/dragEventPipeline.js";import{ManipulatorStateFlags as ve,ManipulatorStateCustomFlags as Me}from"../../../../interactive/interfaces.js";import{tooltipKeys as be}from"../../../../interactive/keybindings.js";import{AccumulationBehavior as xe}from"../../../../interactive/editGeometry/interfaces.js";import{SnappingContext as Ee}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as Oe}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as ye,enterInputModeIfAvailable as je}from"../../../../interactive/tooltip/tooltipCommonUtils.js";const Ie=Symbol();let Se=class extends t{get _operations(){return this.object.operations}constructor(e){super(e),this._selectedIndex=0,this._manipulatorHandles=new o,this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0,this._reshapeEventState=Ue.NONE,this._pendingEdgeOffsetInfo=null,this._updatingHandles=new H,this._recreatingManipulators=!1,this._settings=new q({getTheme:()=>this.view.effectiveTheme}),this.events=new a,this.activeTooltipInfo=null,this._vertexLaserLineVisualElement=null,this._tooltipCallbacks={onBeforeReshape:()=>this.tool.endDrag(),onReshapeStart:()=>this._updateEventState(Ue.RESHAPING),onReshape:()=>this.events.emit("reshape",{type:"reshape",object:this.object}),onReshapeStop:()=>this._updateEventState(Ue.NONE,{forceEnd:!0}),onMoveStart:()=>this._updateEventState(Ue.MOVING),onMove:()=>this.events.emit("move",{type:"move",object:this.object,dx:0,dy:0}),onMoveStop:()=>this._updateEventState(Ue.NONE,{forceEnd:!0})}}initialize(){const{view:e}=this,t=this._settings.manipulators,i=t.vertex;this.tooltipInfos=oe(this._sketchOptions,e),this._vertexManipulatorMaterial=L(n(i.color),i.renderOccluded),this._vertexManipulatorOutlineMaterial=P(n(i.outlineColor),i.renderOccluded),this._vertexManipulatorHoverOutlineMaterial=P(n(i.hoverOutlineColor),i.renderOccluded);const a=t.edge;this._edgeManipulatorMaterial=L(n(a.color),a.renderOccluded),this._edgeManipulatorOutlineMaterial=P(n(a.outlineColor),a.renderOccluded);const o=t.edgeOffset;this._edgeOffsetManipulatorMaterial=L(n(o.color),o.renderOccluded,!1),this._edgeOffsetManipulatorHoverMaterial=L(n(o.hoverColor),o.renderOccluded,!1);const s=t.selected;this._selectedManipulatorMaterial=L(n(s.color),s.renderOccluded),this._selectedManipulatorOutlineMaterial=P(n(s.outlineColor),s.renderOccluded),this._selectedManipulatorHoverOutlineMaterial=P(n(s.hoverOutlineColor),s.renderOccluded),this.tooltip=ye((()=>({view:e,options:this._sketchOptions.tooltips}))),this.addHandles([u((()=>{const e=this._settings.manipulators;return{vertexSettings:e.vertex,edgeSettings:e.edge,edgeOffsetSettings:e.edgeOffset,selectedSettings:e.selected}}),(({vertexSettings:e,edgeSettings:t,edgeOffsetSettings:i,selectedSettings:n})=>{e.applyColor(this._vertexManipulatorMaterial),e.applyOutline(this._vertexManipulatorOutlineMaterial),e.applyHoverOutline(this._vertexManipulatorHoverOutlineMaterial),t.applyColor(this._edgeManipulatorMaterial),t.applyOutline(this._edgeManipulatorOutlineMaterial),i.applyColor(this._edgeOffsetManipulatorMaterial),i.applyHover(this._edgeOffsetManipulatorHoverMaterial),n.applyColor(this._selectedManipulatorMaterial),n.applyOutline(this._selectedManipulatorOutlineMaterial),n.applyHoverOutline(this._selectedManipulatorHoverOutlineMaterial)})),u((()=>this.object.visible),(e=>{for(const t of this._manipulatorInfos)t.manipulator.available=e,Te(t)&&(t.edgeManipulator.available=e)})),u((()=>this._numGrabbing+this._numDragging===0),(e=>this._toggleAutoHideManipulators(e))),u((()=>({labels:this._segmentLabels,enabled:this._sketchOptions.labels.enabled,edgeOffsetEnabled:this.enableEdgeOffset})),(({labels:e,enabled:t,edgeOffsetEnabled:i})=>{null!=e&&(e.visible=t,e.edgeDistance=i?"far":"default")}),c),se(this.tooltip,this.object,(()=>this._tooltipsContext)),u((()=>this.tooltip.mode),((e,t)=>{"input"===t&&"input"!==e&&this._resetTooltip()})),h((()=>this._operations),"vertex-update",(e=>this._updateManipulatorPositions(e.vertices)),{onListenerAdd:()=>this._recreateManipulators()}),h((()=>this._operations?.data),"change",(e=>{"undo"!==e.operation&&"redo"!==e.operation||this._recreateManipulators()}))])}destroy(){this._removeManipulators(),this._updatingHandles.destroy(),this._segmentLabels=p(this._segmentLabels),this.tooltip=p(this.tooltip)}get updating(){return this._updatingHandles.updating}get manipulators(){return this.tool.manipulators}get view(){return this.tool.view}get automaticAreaMeasurementUtils(){return this.tool.automaticAreaMeasurementUtils}get automaticLengthMeasurementUtils(){return this.tool.automaticLengthMeasurementUtils}get object(){return this.tool.object}get enableZShape(){return this.tool.enableZShape}get enableDeleteVertices(){return this.tool.enableDeleteVertices}get enableZVertex(){return this.tool.enableZVertex}get autoHideManipulators(){return this.tool.autoHideManipulators}get enableMoveObject(){return this.tool.enableMoveObject}get enableMidpoints(){return this.tool.enableMidpoints}get enableEdgeOffset(){return this.tool.enableEdgeOffset}get _sketchOptions(){return this.tool.sketchOptions}get _accentColor(){return this.view.effectiveTheme.accentColor}enterInputModeIfAvailable(e){return"key-down"===e.type&&e.key===be.enterInputMode&&("reshape-edge-offset"===this.activeTooltipInfo?.type?this._enterInputModeDuringEdgeOffset(e):!!je(e,this.tooltip)&&(this.tool.endDrag(),!0))}removeSelectedVertices(){const e=this._manipulatorInfos.filter((e=>e.manipulator.selected&&"vertex"===e.type));return this._removeVertices(e),e.length}onManipulatorSelectionChanged(){this.events.emit("manipulators-changed")}_removeManipulators(){this._manipulatorHandles.removeAll(),this._moveManipulation=p(this._moveManipulation),this._objectMoveManipulation=p(this._objectMoveManipulation),this.manipulators.removeAll(),this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0}_createManipulators(e){if(null==this._operations)return;const t=this.object.elevationInfo;for(const i of this._operations.data.components){const n=e?.byComponentIndex.get(i.index);for(const e of i.vertices){const i=n?.has(e.index);this._createVertexOrEdgeManipulator(e,t,i)}for(const e of i.edges)this._createVertexOrEdgeManipulator(e,t)}this._createObjectMoveManipulation(),this._createMoveManipulation(t),this._createVisualElements()}get canRedo(){return null!=this._operations&&this._operations.canRedo}get canUndo(){return null!=this._operations&&this._operations.canUndo}redo(){return this._operations?.redo()}undo(){return this.events.emit("undo"),this._operations?.undo()}_recreateManipulators(){if(!this._recreatingManipulators){if(this._recreatingManipulators=!0,this._removeManipulators(),this._resetTooltip(),this._operations&&this._segmentLabels?.context?.editGeometryOperations===this._operations||(this._segmentLabels=p(this._segmentLabels)),this._createManipulators(),!this._segmentLabels&&this._operations){const e=this._sketchOptions.labels;this._segmentLabels=new N({context:{view:this.view,editGeometryOperations:this._operations,elevationInfo:this.object.elevationInfo,labelOptions:e,automaticLengthMeasurementUtils:this.automaticLengthMeasurementUtils},visible:e.enabled})}this._recreatingManipulators=!1}}_perObjectManipulatorDragAction(e,t){if("end"===t.action)return t;let i=0;const n=[],a=this._manipulatorInfos.some((e=>"vertex"===e.type&&e.manipulator.selected)),o=e===Ce.SELECTED_OR_ALL&&a;for(const s of this._manipulatorInfos)"vertex"===s.type&&(s.manipulator.grabbing||o&&!s.manipulator.selected||n.push(s),i++);this._moveVertices(n,t);if(n.length===i){if(this._updateEventState(Ue.MOVING),this.destroyed)return t;this.events.emit("move",{type:"move",dx:t.screenDeltaX,dy:t.screenDeltaY,object:this.object})}else{if(this._updateEventState(Ue.RESHAPING),this.destroyed)return t;this.events.emit("reshape",{type:"reshape",object:this.object})}return t}_toggleAutoHideManipulators(e){this.autoHideManipulators&&(e?this.removeHandles(Ie):this.tool.manipulators.forEach((({manipulator:e})=>{const t=e.disableDisplay?.();t&&this.addHandles(t,Ie)})))}_isMultiVertexSelection(){return this._manipulatorInfos.reduce(((e,t)=>"vertex"===t.type&&t.manipulator.selected?e+1:e),0)>1}_perVertexManipulatorDragAction(e){if(this._updateEventState(Ue.RESHAPING),this.destroyed)return;const{mapDeltaX:t,mapDeltaY:i,mapDeltaZ:n}=e;if(!t&&!i&&!n)return;const a=[];for(const o of this._manipulatorInfos)"vertex"===o.type&&(o.manipulator.selected&&!o.manipulator.grabbing||o===e.info)&&a.push(o);this._moveVertices(a,e,xe.ACCUMULATE_STEPS),this.events.emit("reshape",{type:"reshape",object:this.object})}_updateEventState(e,t={}){if(e===this._reshapeEventState)return!1;switch(e){case Ue.NONE:if(!t.forceEnd&&(0!==this._numGrabbing||0!==this._numDragging))return!1;switch(this._reshapeEventState){case Ue.MOVING:this.events.emit("move",{type:"move-stop",dx:0,dy:0,object:this.object});break;case Ue.RESHAPING:this.events.emit("reshape",{type:"reshape-stop",object:this.object})}break;case Ue.MOVING:switch(this._reshapeEventState){case Ue.NONE:this.events.emit("move",{type:"move-start",dx:0,dy:0,object:this.object});break;case Ue.RESHAPING:this.events.emit("reshape",{type:"reshape-stop",object:this.object}),this.destroyed||this.events.emit("move",{type:"move-start",dx:0,dy:0,object:this.object})}break;case Ue.RESHAPING:switch(this._reshapeEventState){case Ue.NONE:this.events.emit("reshape",{type:"reshape-start",object:this.object});break;case Ue.MOVING:this.events.emit("move",{type:"move-stop",dx:0,dy:0,object:this.object}),this.destroyed||this.events.emit("reshape",{type:"reshape-start",object:this.object})}}if(this.destroyed)return!1;const i=this._reshapeEventState!==e;return this._reshapeEventState=e,i}_createObjectMoveManipulation(){const{tool:e,view:t,object:i,_operations:n}=this;if(n){if(this._objectMoveManipulation=new Q({tool:e,view:t,object:i}),this.enableMoveObject){let e=null;this._manipulatorHandles.add(this._objectMoveManipulation.createDragPipeline(((t,i,a)=>{i.next((e=>this._trackNumDragging(e))).next((t=>("start"===t.action&&(e=n.createUndoGroup()),t))).next((e=>this._perObjectManipulatorDragAction(Ce.ALL,e))).next((e=>(this._updateTranslateObjectTooltip(K.XY,e),e))).next((t=>{"end"===t.action&&(this._resetTooltip(),e=d(e))})),a.next((()=>this._onDragCancel(!0,(()=>e=d(e)))))}))),this._objectMoveManipulation.forEachManipulator((e=>this._manipulatorHandles.add(this._watchAndUpdateGrabState(e,!1))))}else this._objectMoveManipulation.forEachManipulator((e=>{e.grabbable=!1,e.cursor=null}));this._objectMoveManipulation.forEachManipulator((e=>this._manipulatorHandles.add(e.events.on("immediate-click",(e=>{this._manipulatorInfos.some((e=>e.manipulator.selected))?this._clearSelection():this.events.emit("immediate-click",{...e,object:this.object}),e.stopPropagation()})))))}}_createMoveManipulation(e){const{object:t,tool:i,view:n,_operations:a}=this;if(!a)return;this._moveManipulation=new J({tool:i,view:n,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZShape&&Y(t.operations,t.elevationInfo),snapToScene:!1,radius:J.radiusForSymbol(t.graphic?.symbol)}),this._moveManipulation.forEachManipulator((e=>this.addHandles([e.events.on("immediate-click",(t=>{this._moveManipulation.zManipulation.hasManipulator(e)||this._manipulatorInfos.some((e=>e.manipulator.selected))||this.events.emit("immediate-click",{...t,object:this.object}),t.stopPropagation()})),this._watchAndUpdateGrabState(e,!1)])));const o=e=>t=>{this.addHandles([t.events.on("focus-changed",(({action:t})=>{"focus"===t?this._updateTranslateTooltip(e):this._resetTooltip()}))])};this._moveManipulation.xyManipulation.forEachManipulator(o(K.XY)),this._moveManipulation.xyAxisManipulation.forEachManipulator(o(K.XY_AXIS)),this._moveManipulation.zManipulation.forEachManipulator(o(K.Z)),this._moveManipulation.elevationInfo={mode:"absolute-height",offset:0};const s=a.data.spatialReference;this.addHandles([this._moveManipulation.createDragPipeline(((n,o,s,r,l)=>{const{snappingStep:p,cancelSnapping:d}=Oe({predicate:e=>!!e.info,snappingManager:i.snappingManager,snappingContext:new Ee({editGeometryOperations:a,elevationInfo:e,pointer:l,excludeFeature:t.graphic,visualizer:new k}),updatingHandles:this._updatingHandles,useZ:!1});return r=r.next((e=>(this._onDragCancel(),e))).next(d),{steps:s=s.next((e=>this._trackNumDragging(e))).next((e=>{const t=this._manipulatorInfos.filter((e=>"vertex"===e.type&&e.manipulator.selected));return e.manipulatorType===X.TRANSLATE_XY&&1===t.length?{...e,info:t[0],snapOrigin:t[0].handle.pos}:e})).next(ce(this.view,e,t.graphic??void 0)).next(...p).next(me()).next((e=>this._perObjectManipulatorDragAction(Ce.SELECTED_OR_ALL,e))).next((e=>(this._updateTranslateTooltip(n,e),e))),cancel:r}}),e,s,t.graphic),u((()=>t.visible),(()=>this._updateMoveManipulationPosition()),c),t.on("committed",(()=>{this._recreatingManipulators||this._updateMoveManipulationPosition()})),u((()=>t.isDraped),(e=>{this._updateMoveManipulationPosition();const t="align-move-manipulation";e?this.addHandles(this.view.elevationProvider.on("elevation-change",(()=>this._updateMoveManipulationPosition())),t):this.removeHandles(t)}),c)])}_createVisualElements(){const{object:e,view:t}=this,i=B({view:t,object:e,forEachManipulator:e=>{if(!this.destroyed&&!this._recreatingManipulators){this._objectMoveManipulation.forEachManipulator(e),this._moveManipulation.forEachManipulator(e);for(const t of this._manipulatorInfos)e(t.manipulator,X.TRANSLATE_XY)}},onManipulatorsChanged:e=>this.events.on("manipulators-changed",e)});null!=i&&(this._outlineVisualElement=i.visualElement instanceof pe?i.visualElement:null);const n=this._outlineVisualElement;if(null!=n){const t=()=>{e.isDraped||this._updateMoveManipulationPosition()};this._manipulatorHandles.add(h((()=>n.events),"attachment-origin-changed",t,{onListenerAdd:t}))}this._manipulatorHandles.add(i)}_createEdgeOffsetManipulator(e,t=this.object.elevationInfo){const i=this.view,n=this._operations;if(e.component.vertices.length<=2||!n)return null;const a=n.data.spatialReference,o=this._settings.manipulators.edgeOffset,r=o.size/2,l=r+o.collisionPadding,p=r/l,d=p/2,u=p*Math.sqrt(3)/2,{height:h,offset:c}=o,m=this._edgeOffsetManipulatorMaterial;if(!this._edgeOffsetManipulatorGeometryInside){const e=de(m,u,d,d,h,c);this._edgeOffsetManipulatorGeometryInside=e}if(!this._edgeOffsetManipulatorGeometryOutside){const e=de(m,-u,d,d,h,-c);this._edgeOffsetManipulatorGeometryOutside=e}const g=[new C(this._edgeOffsetManipulatorGeometryInside.instantiate(),ve.Unfocused),new C(this._edgeOffsetManipulatorGeometryInside.instantiate({material:this._edgeOffsetManipulatorHoverMaterial}),ve.Focused),new C(this._edgeOffsetManipulatorGeometryOutside.instantiate(),ve.Unfocused),new C(this._edgeOffsetManipulatorGeometryOutside.instantiate({material:this._edgeOffsetManipulatorHoverMaterial}),ve.Focused)],f=new D({view:i,renderObjects:g,elevationInfo:"on-the-ground"!==t.mode||G(this.object.graphic?.symbol)?{mode:"absolute-height",offset:0}:t,worldOriented:!1,focusMultiplier:1,radius:l,available:this.object.visible,collisionType:{type:"disc",direction:I(0,0,1)},collisionPriority:1,metadata:{deleting:!1},location:Ae(a)}),_=new D({view:i,worldSized:!0,worldOriented:!1,available:this.object.visible,collisionPriority:-10,cursor:this.enableMoveObject?"move":"default",metadata:{deleting:!1},location:Ae(a)}),v={manipulator:f,handle:e,locationUpdateHandle:null,type:"edge",selectedIndex:0,edgeManipulator:_,visibilityHandle:null};this._autoHideEdgeOffsetManipulator(v,o.minSquaredEdgeLength);const M=()=>this._updateEdgeOffsetManipulator(v);M(),v.locationUpdateHandle=s([e.leftVertex,e.rightVertex].map((e=>{const t=this._getManipulatorInfoFromHandle(e);return t?.manipulator.events.on("location-update",M)})));const b=e=>{this._manipulatorInfos.some((e=>e.manipulator.selected))?this._clearSelection():this.events.emit("immediate-click",{...e,object:this.object}),e.stopPropagation()};return this._manipulatorHandles.add([v.locationUpdateHandle,this._watchAndUpdateGrabState(f,!0),this._watchAndUpdateGrabState(_,!0),ge(f,this._createEdgeOffsetPipeline(v,t,n)),ge(_,this._createEdgePipeline(v,t,n)),_.events.on("immediate-click",b),f.events.on("immediate-click",b),f.events.on("focus-changed",(()=>this._resetTooltip())),f.events.on("grab-changed",(({screenPoint:e,action:t})=>{v.grabMapPoint="start"===t?$(e,this.view,this.object,v):null}))],f),this._manipulatorInfos.push(v),this.manipulators.addMany([f,_]),this.events.emit("manipulators-changed"),v}_autoHideEdgeOffsetManipulator(e,t){const i=e.manipulator,n=e.edgeManipulator,a=()=>{e.visibilityHandle=d(e.visibilityHandle);const a=this._getManipulatorInfoFromHandle(e.handle.leftVertex),o=this._getManipulatorInfoFromHandle(e.handle.rightVertex),l=null!=a&&null!=o&&ne(a.manipulator.renderLocation,o.manipulator.renderLocation,this.view.state.camera)<t;(!i.focused&&!n.focused||l)&&(i.grabbable=!l,n.grabbable=!l,e.visibilityHandle=s([i.disableDisplay(),r((()=>{i.grabbable=!0,n.grabbable=this.enableMoveObject}))]))};this._manipulatorHandles.add([i.events.on("focus-changed",a),n.events.on("focus-changed",a),r((()=>{d(e.visibilityHandle),n.metadata.deleting=!0,this.manipulators.remove(n)}))],i),a()}_updateEdgeOffsetManipulator(e){if(!this._operations)return;this._updateManipulatorPosition(e);const{coordinateHelper:t}=this._operations.data,i=ee(this.view,e.manipulator.elevationAlignedLocation,te(t,e.handle,e.manipulator.elevationInfo)),n=this._getManipulatorInfoFromHandle(e.handle.leftVertex),a=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(null==n||null==a)return;const o=n.manipulator.renderLocation,s=a.manipulator.renderLocation,r=null!=i?ie(i,o,s):M;e.manipulator.modelTransform=r,e.edgeManipulator.elevationAlignedLocation=e.manipulator.elevationAlignedLocation,e.edgeManipulator.modelTransform=r;const l=b(x(De,o,s))/2;e.edgeManipulator.collisionType={type:"line",paths:[[[-l,0,0],[l,0,0]]]}}_createEdgePipeline(e,t,i){return(n,a,o,s)=>{if("touch"===s){this._createEdgeOffsetPipeline(e,t,i)(n,a,o)}else if(this.enableMoveObject){const e=this.object.graphic,s=i.data.spatialReference,{elevationAlignedLocation:r}=n;a.next((e=>this._trackNumDragging(e))).next(fe(this.view,r)).next(R(this.view,r,t,s,e)).next(_e()).next(me()).next((e=>this._perObjectManipulatorDragAction(Ce.ALL,e))).next((e=>(this._updateTranslateObjectTooltip(K.XY,e),e))).next((e=>{"end"===e.action&&this._resetTooltip()})),o.next((()=>this._onDragCancel(!n.metadata.deleting)))}}}_createEdgeOffsetPipeline(e,t,i){return(n,a,o)=>{const s=this._pendingEdgeOffsetInfo;if(s?.manipulatorInfo===e&&"drag"!==s.mode)return void o.execute({action:"cancel"});this._clearSelection();const{initializeStep:r,cleanup:l}=this._initializeEdgeOffset(e,t,i,o),p=this._applyEdgeOffsetStep(e);a.next((e=>this._trackNumDragging(e))).next(fe(this.view,n.elevationAlignedLocation)).next(r).next(z(this.view)).next(F(this.view,i.data.spatialReference)).next(me()).next(He()).next((e=>this._pendingEdgeOffsetInfo?e:p(e))).next((e=>{"end"!==e.action||this._pendingEdgeOffsetInfo||l()})),o.next((()=>{this._exitEdgeOffsetInputMode(),n.metadata.deleting||(l(),this._onDragCancel())}))}}_initializeEdgeOffset(e,t,i,n){const{view:a,object:o}=this,r=te(i.data.coordinateHelper,e.handle,t),l=i.createUndoGroup(),p=ee(a,e.manipulator.elevationAlignedLocation,r);let u;this._splitEdgesBeforeEdgeOffset(e,r),this._selectEdgeOffsetArrow(e,r);const h=()=>{this._cleanEdgeOffsetCollapsedEdges(e,i),u=d(u)},c=this.events.on("undo",h);return u=s([this._initializeEdgeOffsetVisualElement(e,o,t,i),l,c,this._connectEdgeOffsetTooltip(e,r,i,(()=>{n.execute({action:"cancel"})}))]),{initializeStep:e=>null==r||null==p?(h(),null):{...e,operation:r,plane:p},cleanup:h}}_initializeEdgeOffsetVisualElement(e,t,i,a){const o=()=>new V({paths:[[e.handle.leftVertex.pos,e.handle.rightVertex.pos]],spatialReference:a.data.spatialReference}),r=new pe({view:this.view,isDraped:t.isDraped,geometry:o(),elevationInfo:i,width:this._settings.visualElements.lineObjects.outline.width,attached:!1,isDecoration:!0}),p=s([u((()=>({color:this._accentColor,draped:t.isDraped})),(({color:e,draped:t})=>{r.color=n(e),r.isDraped=t}),m),t.on("committed",(()=>{r.geometry=o()})),l(r)]);return r.attached=!0,p}_applyEdgeOffsetStep(e){return t=>(this.destroyed||null==t.operation||!this._operations||(this._updateEventState(Ue.RESHAPING),null==t.signedDistance?this._resetTooltip():((t.mapDeltaX||t.mapDeltaY||t.mapDeltaZ)&&(this._offsetEdge(e,t.operation,t.signedDistance),this.events.emit("reshape",{type:"reshape",object:this.object})),this._updateEdgeOffsetTooltip(t))),t)}_cleanEdgeOffsetCollapsedEdges(e,t){const i=e.handle.leftVertex.leftEdge?.leftVertex,n=e.handle.leftVertex,a=e.handle.rightVertex.rightEdge?.rightVertex,o=e.handle.rightVertex,s=t.data.coordinateHelper,r=this.view.pixelSizeAt(s.vectorToDehydratedPoint(n.pos),s.spatialReference),l=[];if(i&&s.distance(i.pos,n.pos)<Le){const e=this._getManipulatorInfoFromHandle(n);null!=e&&l.push(e)}if(s.distance(n.pos,o.pos)<r||a&&s.distance(a.pos,o.pos)<Le){const e=this._getManipulatorInfoFromHandle(o);null!=e&&l.push(e)}l.length&&this._removeVertices(l)}_enterInputModeDuringEdgeOffset(e){const t=this._findActiveEdgeOffsetManipulatorInfo();return!!t&&(!!je(e,this.tooltip)&&(t.manipulator.dragging?(this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:"drag"},!0):(this._clearSelection(),this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:"hover"},this._connectEdgeOffsetTooltipOnHover(t),!0)))}_exitEdgeOffsetInputMode(){this.tooltip&&(this._pendingEdgeOffsetInfo=null,this._resetTooltip(),this.tooltip.exitInputMode())}_findActiveEdgeOffsetManipulatorInfo(){return this._manipulatorInfos.filter(Te).find((({manipulator:e})=>e.hovering||e.grabbing||e.dragging))}_connectEdgeOffsetTooltipOnHover(e){const{_operations:t,object:i}=this;if(!t)return;const{elevationInfo:n}=i,a=te(t.data.coordinateHelper,e.handle,n);this._selectEdgeOffsetArrow(e,a),this.addHandles([this._initializeEdgeOffsetVisualElement(e,i,n,t),this._connectEdgeOffsetTooltip(e,a,t,(()=>{this.removeHandles(a),this._exitEdgeOffsetInputMode()}))],a)}_splitEdgesBeforeEdgeOffset(e,t){if(t.requiresSplitEdgeLeft){const t=this._getManipulatorInfoFromHandle(e.handle.leftVertex.leftEdge);null!=t&&this._splitEdgeManipulator(t,1)}if(t.requiresSplitEdgeRight){const t=this._getManipulatorInfoFromHandle(e.handle.rightVertex.rightEdge);null!=t&&this._splitEdgeManipulator(t,0)}}_selectEdgeOffsetArrow(e,t){const i=e.grabMapPoint??$(this.view.inputManager?.latestPointerLocation,this.view,this.object,e);i&&t.selectArrowFromStartPoint(i)}_connectEdgeOffsetTooltip(e,t,i,n){const a=()=>this.tooltipInfos.edgeOffset.distance.actual,o=a=>{n(),queueMicrotask((()=>{this.view.focus();const n=i.createUndoGroup();this._tooltipCallbacks.onReshapeStart?.(),this._splitEdgesBeforeEdgeOffset(e,t),this._offsetEdge(e,t,ae(a,e.manipulator.location,t,i)),this._tooltipCallbacks.onReshape?.(),this._tooltipCallbacks.onReshapeStop?.(),this._cleanEdgeOffsetCollapsedEdges(e,i),n.remove()}))},r=()=>{const e=a();null!=e?o(e):n()};return s([g((()=>this.tooltip&&!this.tooltip.focused),(()=>r()),f),this.tooltip.on("discard",n),this.tooltip.on("commit",(e=>{"commit-and-exit"===e.type&&r()}))])}_createVertexOrEdgeManipulator(e,t=this.object.elevationInfo,i=!1){const n=this.view,a=this._operations,o=this._settings;if(!a)return null;const r=a.data.type,l=a.data.spatialReference;if("edge"===e.type){if(this.enableEdgeOffset)return this._createEdgeOffsetManipulator(e,t);if(!this.enableMidpoints)return null}if(null==this._vertexManipulatorGeometry||null==this._vertexManipulatorOutlineGeometry){const{size:e,outlineSize:t}=we(o.manipulators.vertex);this._vertexManipulatorGeometry=ue(this._vertexManipulatorMaterial,e,16,16),this._vertexManipulatorOutlineGeometry=ue(this._vertexManipulatorOutlineMaterial,t,16,16)}if(null==this._edgeManipulatorGeometry||null==this._edgeManipulatorOutlineGeometry){const{size:e,outlineSize:t}=we(o.manipulators.edge);this._edgeManipulatorGeometry=ue(this._edgeManipulatorMaterial,e,16,16),this._edgeManipulatorOutlineGeometry=ue(this._edgeManipulatorOutlineMaterial,t,16,16)}const p="point"===r||"mesh"===r?[]:[new C(this._vertexManipulatorGeometry.instantiate(),Pe.Vertex|ve.Unselected),new C(this._vertexManipulatorOutlineGeometry.instantiate(),Pe.Vertex|ve.Unfocused|ve.Unselected),new C(this._vertexManipulatorOutlineGeometry.instantiate({material:this._vertexManipulatorHoverOutlineMaterial}),Pe.Vertex|ve.Focused|ve.Unselected),new C(this._vertexManipulatorGeometry.instantiate({material:this._selectedManipulatorMaterial}),ve.Selected),new C(this._vertexManipulatorOutlineGeometry.instantiate({material:this._selectedManipulatorOutlineMaterial}),ve.Selected|ve.Unfocused),new C(this._vertexManipulatorOutlineGeometry.instantiate({material:this._selectedManipulatorHoverOutlineMaterial}),ve.Selected|ve.Focused)];this.enableMidpoints&&p.push(new C(this._edgeManipulatorGeometry.instantiate({material:this._vertexManipulatorMaterial}),Pe.Edge|ve.Focused|ve.Unselected),new C(this._edgeManipulatorOutlineGeometry.instantiate({material:this._vertexManipulatorHoverOutlineMaterial}),Pe.Edge|ve.Focused|ve.Unselected),new C(this._edgeManipulatorGeometry.instantiate(),Pe.Edge|ve.Unfocused|ve.Unselected),new C(this._edgeManipulatorOutlineGeometry.instantiate(),Pe.Edge|ve.Unfocused|ve.Unselected));const u=new D({view:n,renderObjects:p,elevationInfo:t,focusMultiplier:1,touchMultiplier:1,available:this.object.visible,metadata:{deleting:!1},location:Ae(l)});u.selected=i,this._setTypeSpecificManipulatorSettings(u,e,t);const h="edge"===e.type?{manipulator:u,handle:e,locationUpdateHandle:null,type:"edge",selectedIndex:0}:{manipulator:u,handle:e,type:"vertex",selectedIndex:0};if(this._manipulatorInfos.push(h),this.manipulators.add(u),this._updateManipulatorPosition(h),"edge"===h.type){const e=[];for(const t of[h.handle.leftVertex,h.handle.rightVertex]){const i=this._getManipulatorInfoFromHandle(t);null!=i&&e.push(i.manipulator.events.on("location-update",(()=>this._updateManipulatorPosition(h))))}h.locationUpdateHandle=s(e),this._manipulatorHandles.add(h.locationUpdateHandle,u)}this._manipulatorHandles.add(this._watchAndUpdateGrabState(u,!0),u);const c=ge(u,((e,i,o,s)=>{let r=null;const{snappingStep:p,cancelSnapping:u}=Oe({predicate:()=>!this._isMultiVertexSelection(),snappingManager:this.tool.snappingManager,snappingContext:new Ee({editGeometryOperations:a,elevationInfo:t,pointer:s,excludeFeature:this.object.graphic,visualizer:new k}),updatingHandles:this._updatingHandles,useZ:!1});o=o.next((t=>(this._onDragCancel(!e.metadata.deleting,(()=>r=d(r))),t))).next(u);const{elevationAlignedLocation:c}=e,m=this.object.graphic??void 0;i.next((e=>this._trackNumDragging(e))).next((e=>{if("start"===e.action&&a&&(r=a.createUndoGroup()),"edge"===h.type){const t=this._splitEdgeManipulator(h);return{...e,info:t,snapOrigin:t.handle.pos}}return{...e,info:h,snapOrigin:h.handle.pos}})).next(fe(n,c)).next(R(n,c,t,l,m)).next(ce(n,t,m)).next(...p).next(me()).next((e=>{this._perVertexManipulatorDragAction(e),"end"===e.action&&(r=d(r)),this._resetTooltip()}))}));return this._manipulatorHandles.add([c,u.events.on("immediate-click",(e=>this._manipulatorClickCallback(e,h))),u.events.on("select-changed",(()=>{h.selectedIndex=++this._selectedIndex,this._updateMoveManipulationPosition(),this._resetTooltip()})),u.events.on("focus-changed",(()=>{this._resetTooltip()}))],u),this.events.emit("manipulators-changed"),h}_trackNumDragging(e){switch(e.action){case"start":this._numDragging++;break;case"end":this._numDragging--}return e}_onDragCancel(e=!0,t){switch(this._numDragging--,e&&this.undo(),this.tool.snappingManager?.doneSnapping(),this._resetTooltip(),this._reshapeEventState){case Ue.NONE:break;case Ue.MOVING:this.events.emit("move",{type:"move",dx:0,dy:0,object:this.object});break;case Ue.RESHAPING:this.events.emit("reshape",{type:"reshape",object:this.object})}t?.(),this.destroyed||this._updateEventState(Ue.NONE)}_setTypeSpecificManipulatorSettings(e,t,i){const n=this._settings;switch(t.type){case"vertex":{e.state=Pe.Vertex,e.selectable=!0,e.cursor="move",e.collisionPriority=2;const{size:t,collisionPadding:a}=n.manipulators.vertex;e.radius=t/2+a,e.elevationInfo=i;const o=this._operations?.data.type;e.interactive=null!=o&&"point"!==o&&"mesh"!==o;break}case"edge":{e.state=Pe.Edge,e.selectable=!1,e.cursor="copy",e.collisionPriority=-1;const{size:t,collisionPadding:a}=n.manipulators.edge;e.radius=t/2+a,e.elevationInfo="on-the-ground"!==i.mode||G(this.object.graphic?.symbol)?{mode:"absolute-height",offset:0}:i;break}}}_watchAndUpdateGrabState(e,t){return e.events.on("grab-changed",(i=>{this._onGrabStateChanged(e,t,i.action,i.pointerType)}))}_onGrabStateChanged(e,t,i,n="mouse"){if(!this._recreatingManipulators){if("start"===i)t&&this._updateSelection(e),this._numGrabbing++;else if(this._numGrabbing--,this._updateEventState(Ue.NONE),this.destroyed)return;this._moveManipulation.interactive=!this._numGrabbing,("touch"!==n||this.enableEdgeOffset)&&(this._manipulatorInfos.forEach((e=>{const{manipulator:t}=e,i=this._operations?.data.type;t.interactive=t.grabbing||!this._numGrabbing&&null!=i&&"point"!==i&&"mesh"!==i,Te(e)&&(e.edgeManipulator.interactive=e.edgeManipulator.grabbing||!this._numGrabbing)})),this._objectMoveManipulation.forEachManipulator((e=>{e.interactive=e.grabbing||!this._numGrabbing})))}}_clearSelection(){for(const e of this._manipulatorInfos)e.manipulator.grabbing||(e.manipulator.selected=!1);this._pendingEdgeOffsetInfo=null}_updateSelection(e){e.grabbing&&!e.selected&&e.selectable&&(this._clearSelection(),e.selected=!0,this.events.emit("manipulators-changed"))}_removeManipulator(e){null!=e&&(e.manipulator.metadata.deleting=!0,this.manipulators.remove(e.manipulator),this._manipulatorHandles.remove(e.manipulator),i(this._manipulatorInfos,e),this.events.emit("manipulators-changed"),this._resetTooltip())}_getManipulatorInfoFromHandle(e){if(e)for(const t of this._manipulatorInfos)if(e===t.handle)return t;return null}_updateManipulatorPositions(e){for(const t of e)this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(t))}_updateManipulatorPosition(e){const t=this._operations;if(null!=e&&t)if("vertex"===e.type)e.manipulator.location=t.data.coordinateHelper.vectorToDehydratedPoint(e.handle.pos,Ge),e.manipulator.grabbing&&null!=this._vertexLaserLineVisualElement&&(this._vertexLaserLineVisualElement.visualElement.intersectsWorldUpAtLocation=e.manipulator.renderLocation);else if("edge"===e.type){const i=this._getManipulatorInfoFromHandle(e.handle.leftVertex),n=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(null==i||null==n)return;const a=i.manipulator,o=n.manipulator;if("on-the-ground"===e.manipulator.elevationInfo?.mode){const i=a.location,n=o.location,s=.5,r=i.x+s*(n.x-i.x),l=i.y+s*(n.y-i.y),p=i.hasZ&&n.hasZ?0:void 0;e.manipulator.location=T(r,l,p,t.data.spatialReference)}else E(De,a.renderLocation,o.renderLocation,.5),e.manipulator.renderLocation=De}}_splitEdgeManipulator(e,t=.5){const i=this._operations,n=i.splitEdge(e.handle,t).createdVertex;e.locationUpdateHandle=d(e.locationUpdateHandle);const a=this.object.elevationInfo;let o;this.enableEdgeOffset?(this._removeManipulator(e),o=this._createVertexOrEdgeManipulator(n)):(o=e,o.handle=n,o.type="vertex",this._setTypeSpecificManipulatorSettings(e.manipulator,e.handle,a)),n.leftEdge&&this._createVertexOrEdgeManipulator(n.leftEdge),n.rightEdge&&this._createVertexOrEdgeManipulator(n.rightEdge),this._updateManipulatorPosition(o),this.enableEdgeOffset||this._resetTooltip(),this._updateSelection(e.manipulator);const s=this._updateEventState(Ue.RESHAPING),r=i.data.coordinateHelper.vectorToArray(o.handle.pos),l=i.data.components.indexOf(n.component);return this.events.emit("vertex-add",{type:"vertex-add",object:this.object,vertices:[{coordinates:r,componentIndex:l,vertexIndex:n.index}],added:r}),s&&this._updateEventState(Ue.NONE),o}_updateMoveManipulationPosition(){const e=O(De,0,0,0);let t=0,i=!1,n=null,a=null;for(const r of this._manipulatorInfos)"vertex"===r.type&&(r.manipulator.selected?(t++,y(e,e,r.manipulator.renderLocation),null==n||r.selectedIndex>n.selectedIndex?(a=n,n=r):(null==a||r.selectedIndex>a.selectedIndex)&&(a=r)):i=!0);const o=this.object,s=this._operations?.data.geometry;if(0===t){const e=o.visible&&this.enableMoveObject;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e,this._moveManipulation.zManipulation.available=e&&this.enableZShape&&Y(this._operations,o.elevationInfo),this._moveManipulation.angle=Z(s),this._moveManipulation.radius=J.radiusForSymbol(o.graphic?.symbol)}else{const e=o.visible;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.zManipulation.available=e&&this.enableZVertex&&Y(this._operations,this.object.elevationInfo),this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e&&1!==t;let i=0;if(null!=n){const e=n.handle.pos,t=null!=a?a.handle.pos:n.handle.leftEdge?.leftVertex?n.handle.leftEdge.leftVertex.pos:null,o=null==a&&n.handle.rightEdge?.rightVertex?n.handle.rightEdge.rightVertex.pos:null;t&&o?this._moveManipulation.xyAxisManipulation.available=!1:t?i=Ve(t,e):o&&(i=Ve(e,o))}this._moveManipulation.angle=i,this._moveManipulation.radius=W}0!==t&&i?(j(e,e,1/t),Ge.spatialReference=this._operations.data.spatialReference,Ge.hasZ=!0,this.view.renderCoordsHelper.fromRenderCoords(e,Ge),this._moveManipulation.elevationAlignedLocation=Ge):null==this._outlineVisualElement||this.object.isDraped||null==this._outlineVisualElement.attachmentOrigin?U(this._moveManipulation,this.object):this._moveManipulation.elevationAlignedLocation=this._outlineVisualElement.attachmentOrigin}_removeVertices(e){const t=new Array,i=this._operations;if(i){for(const n of e){const e=n.handle.component;if("vertex"===n.type&&i.canRemoveVertex(e)){t.push(n.handle),this._removeManipulator(n),this._removeManipulator(this._getManipulatorInfoFromHandle(n.handle.leftEdge)),this._removeManipulator(this._getManipulatorInfoFromHandle(n.handle.rightEdge));const a=i.removeVertices([n.handle]),o=a.removedVertices?.[0].createdEdge;o?this._createVertexOrEdgeManipulator(o):this.enableEdgeOffset&&e.vertices.length<=2&&this._removeManipulator(this._getManipulatorInfoFromHandle(e.edges[0]))}}if(t.length>0){const e=t.map((e=>{const t=i.data.components.indexOf(e.component);return{coordinates:i.data.coordinateHelper.vectorToArray(e.pos),componentIndex:t,vertexIndex:e.index}})),n=this._updateEventState(Ue.RESHAPING);if(this.destroyed)return;if(this.events.emit("vertex-remove",{type:"vertex-remove",object:this.object,removed:e.map((e=>e.coordinates)),vertices:e}),this.destroyed)return;if(n&&(this._updateEventState(Ue.NONE),this.destroyed))return;this._updateMoveManipulationPosition()}}}_moveVertices(e,t,i=("start"===t.action?xe.NEW_STEP:xe.ACCUMULATE_STEPS)){const n=this._operations;if(n){e.length>0&&n.moveVertices(e.map((e=>e.handle)),t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,i);for(const t of e)this._updateManipulatorPosition(t)}}_offsetEdge(e,t,i){if(!this._operations)return;const n=t.clone();n.distance=i,this._operations.updateVertices([e.handle.leftVertex,e.handle.rightVertex],n),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.leftVertex)),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.rightVertex))}_manipulatorClickCallback(e,t){e.shiftKey||this._clearSelection(),"vertex"===t.type&&(t.manipulator.selected=!t.manipulator.selected,this.enableDeleteVertices&&e.button===he.Right&&this._removeVertices([t])),"edge"===t.type&&e.button===he.Left&&this._splitEdgeManipulator(t),e.stopPropagation()}_updateTranslateTooltip(e,t){null!=this._defaultTooltipInfo?this._resetTooltip():this._updateTranslateObjectTooltip(e,t)}_updateTranslateObjectTooltip(e,t){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=re(e,t,this._tooltipsContext))}_updateEdgeOffsetTooltip(e){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=le(this.object,e,this._tooltipsContext))}_resetTooltip(){const e=this.activeTooltipInfo;if(this._pendingEdgeOffsetInfo&&"reshape-edge-offset"===e?.type)return;let t=null;t=this._pendingEdgeOffsetInfo||null!=this._findActiveEdgeOffsetManipulatorInfo()?le(this.object,null,this._tooltipsContext):this._defaultTooltipInfo,t!==e&&(null!=e&&null!=t&&"input"===this.tooltip.mode||(this.activeTooltipInfo=t))}get _defaultTooltipInfo(){const e=this._operations?.data.type;switch(e){case"polyline":case"polygon":return this._selectedVertexManipulatorInfo?this.tooltipInfos.selectedVertex:null;case"point":case"mesh":return this.tooltipInfos.movePoint;default:return null}}get _selectedVertexManipulatorInfo(){const e=this._manipulatorInfos.filter((e=>"vertex"===e.type&&e.manipulator.selected));return 1===e.length?e[0]:null}get _tooltipsContext(){const{tooltipInfos:e,activeTooltipInfo:t,automaticAreaMeasurementUtils:i,automaticLengthMeasurementUtils:n}=this;return{sketchOptions:this._sketchOptions,tooltipInfos:e,activeTooltipInfo:t,selectedVertexManipulatorInfo:this._selectedVertexManipulatorInfo,callbacks:this._tooltipCallbacks,automaticAreaMeasurementUtils:i,automaticLengthMeasurementUtils:n}}get test(){}};function He(){return e=>{const{operation:t,mapEnd:i}=e;return null==t||null==i?e:{...e,signedDistance:t.signedDistanceToPoint(i)}}}function we(e){const t=e.size/2,i=t+e.collisionPadding;return{size:t/i,outlineSize:(t+e.outlineSize)/i}}function Ve(e,t){return Math.atan2(t[1]-e[1],t[0]-e[0])+Math.PI/2}function Ae(e){return new w({x:0,y:0,z:0,spatialReference:e})}function Te(e){return"edge"===e.type&&"edgeManipulator"in e}e([_()],Se.prototype,"_numGrabbing",void 0),e([_()],Se.prototype,"_numDragging",void 0),e([_()],Se.prototype,"_pendingEdgeOffsetInfo",void 0),e([_()],Se.prototype,"_operations",null),e([_()],Se.prototype,"_segmentLabels",void 0),e([_({constructOnly:!0})],Se.prototype,"tool",void 0),e([_()],Se.prototype,"tooltip",void 0),e([_()],Se.prototype,"activeTooltipInfo",void 0),e([_({readOnly:!0})],Se.prototype,"updating",null),e([_()],Se.prototype,"manipulators",null),e([_()],Se.prototype,"view",null),e([_()],Se.prototype,"automaticAreaMeasurementUtils",null),e([_()],Se.prototype,"automaticLengthMeasurementUtils",null),e([_()],Se.prototype,"object",null),e([_()],Se.prototype,"enableZShape",null),e([_()],Se.prototype,"enableDeleteVertices",null),e([_()],Se.prototype,"enableZVertex",null),e([_()],Se.prototype,"autoHideManipulators",null),e([_()],Se.prototype,"enableMoveObject",null),e([_()],Se.prototype,"enableMidpoints",null),e([_()],Se.prototype,"enableEdgeOffset",null),e([_()],Se.prototype,"_sketchOptions",null),e([_()],Se.prototype,"_accentColor",null),e([_()],Se.prototype,"_tooltipsContext",null),Se=e([v("esri.views.3d.interactive.editingTools.reshape.ReshapeOperation")],Se);const Ge=T(0,0,void 0,A.WGS84),De=S(),Le=1e-6;var Pe,Ue,Ce;!function(e){e.Vertex=Me.Custom1,e.Edge=Me.Custom2}(Pe||(Pe={})),function(e){e[e.NONE=0]="NONE",e[e.MOVING=1]="MOVING",e[e.RESHAPING=2]="RESHAPING"}(Ue||(Ue={})),function(e){e[e.ALL=0]="ALL",e[e.SELECTED_OR_ALL=1]="SELECTED_OR_ALL"}(Ce||(Ce={}));export{Se as ReshapeOperation};