/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import r from"../../../core/Error.js";import{closestPointsOnBezierCurve as i}from"./bezierCurveUtils.js";import{closestPointOnCircle as t}from"./circleUtils.js";import{deriveCircleFromCircularArc as o}from"./circularArcUtils.js";import{isCoordinate as e,isBezierCurve as s,isCircularArc as c,isEllipticArc4 as n}from"./curveUtils.js";import{deriveCircleFromEllipticArc4 as l}from"./ellipticArc4Utils.js";import{deriveEllipse as m,closestPointOnEllipse as f}from"./ellipticArc7Utils.js";import{closestPointOnLine as p}from"./lineUtils.js";function u(u,j,U){if(e(j))return p(u,j,U);if(s(j)){const t=i(u,j,U)[0];if(null==t)throw new r("closestPointOnCurve:unexpected-error","Failed to find close point on bezier curve");return t}if(c(j)){const r=o(u,j);return t(r,U)}if(n(j)){const r=l(u,j);return t(r,U)}const v=m(u,j);return f(v,U)}export{u as closestPointOnCurve};
