// All material copyright Esri, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.30/esri/copyright.txt for details. //>>built define("exports ../../../core/libs/gl-matrix-2/math/vec2 ../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../support/elevationInfoUtils ../sketch/normalizedPoint ./SnappingAlgorithm ./snappingUtils ./candidates/RightAngleTriangleSnappingCandidate ../support/viewUtils ../../support/geometry2dUtils".split(" "),function(h,k,q,l,e,r,t,u,m,v){class w extends r.SnappingAlgorithm{snapNewVertex(g,a){var d=a.editGeometryOperations.data.components[0];const b=[];var f=d.vertices.length;if("polygon"!== a.editGeometryOperations.data.type||2>f)return b;var {view:c}=this;f=d.vertices[f-1];d=e.fromAnyMapPoint(d.vertices[0].pos,c,a);c=e.fromAnyMapPoint(f.pos,c,a);this._processCandidateProposal(d,c,g,a,b);return b}snapExistingVertex(g,a){const d=[];var b=a.vertexHandle,f=b.component;if(2>f.edges.length||"polyline"===a.editGeometryOperations.data.type&&(0===b.index||b.index===f.vertices.length-1))return d;const {view:c}=this;f=e.fromAnyMapPoint(b.leftEdge.leftVertex.pos,c,a);b=e.fromAnyMapPoint(b.rightEdge.rightVertex.pos, c,a);this._processCandidateProposal(f,b,g,a,d);return d}_processCandidateProposal(g,a,d,b,f){if(this.exceedsShortLineThreshold(g,a,b)){var c=k.lerp(n,e.asVec2(g),e.asVec2(a),.5),x=.5*k.distance(e.asVec2(g),e.asVec2(a));c=v.projectPointToCircle(n,e.asVec2(d),c,x);c=e.markAsTarget(e.fromValues(c[0],c[1],d[2]));var {spatialReference:p,pointer:y}=b;d=m.vectorToScreenPoint(d,p,l.absoluteHeightElevationInfo,this.view);t.squaredScreenDistance(d,m.vectorToScreenPoint(c,p,l.absoluteHeightElevationInfo,this.view))< this.squaredProximityThreshold(y)&&!this.isVertical(g,c,b)&&!this.isVertical(c,a,b)&&f.push(new u.RightAngleTriangleSnappingCandidate({targetPoint:c,point1:g,point2:a,isDraped:"on-the-ground"===b.elevationInfo?.mode}))}}}const n=q.create();h.RightAngleTriangleSnapper=w;Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})});