/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../chunks/_rollupPluginBabelHelpers","../../../core/maybe","./Settings","./snappingUtils","../support/viewUtils"],(function(e,t,i,s,o,r){"use strict";let n=function(){function e(e,t){this.view=e,this.options=t,this.squaredShortLineThreshold=s.defaults.shortLineThreshold*s.defaults.shortLineThreshold}var n=e.prototype;return n.snap=function(e,t){return i.isSome(t.vertexHandle)?"vertex"!==t.vertexHandle.type?[]:this.snapExistingVertex(e,t):this.snapNewVertex(e,t)},n.edgeExceedsShortLineThreshold=function(e,t){return this.exceedsShortLineThreshold(e.leftVertex.pos,e.rightVertex.pos,t)},n.exceedsShortLineThreshold=function(e,t,{elevationInfo:i,editGeometryOperations:s}){const n=s.data.coordinateHelper;return 0===this.squaredShortLineThreshold||o.squareDistance(r.anyMapPointToScreenPoint(t,n,i,this.view),r.anyMapPointToScreenPoint(e,n,i,this.view))>this.squaredShortLineThreshold},n.squaredProximityTreshold=function(e){return"touch"===e?this.squaredTouchProximityThreshold:this.squaredMouseProximityTreshold},t._createClass(e,[{key:"squaredMouseProximityTreshold",get:function(){return this.options.distance*this.options.distance}},{key:"squaredTouchProximityThreshold",get:function(){const{distance:e,touchSensitivityMultiplier:t}=this.options,i=e*t;return i*i}}]),e}();e.SnappingAlgorithm=n,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
